4 Replies Latest reply on May 14, 2011 4:33 PM by Ned Murphy

    OnClipEvent

    siremorganmedia Level 1

      Hey. I am having problems getting some movieclips to link to different URLs on release. I  am able to get them to animate, and I am able to get them to link to an  html page seperately, but I can’t get both functionalities to  work at the same time (animate and geturl) and it is driving me crazy!!  I've tried putting  the actionscript in the instance object, in the action layer, and other  things and nothing seems to work!?

       

      I've tried several variations of this without any luck! Any suggestions?

       


      onClipEvent (load) {
      num = 3;
      }
      on (release) {
      getURL("www.mysite.com", "_self");
      }

        • 1. Re: OnClipEvent
          Ned Murphy Adobe Community Professional & MVP

          Give the movieclip an instance name via the properties panel ("mc" for example).  Then place the following code in the timeline that contains the movieclip...

           

          mc.onRelease = function(){
              getURL("www.mysite.com", "_self");
          }

          1 person found this helpful
          • 2. Re: OnClipEvent
            siremorganmedia Level 1

            Thanks Ned, but i tried that earlier, althought the link worked. The rollover animation didn't. This is the only actionscript that's on the timeline where my

            movieclip is:

             

            this["butt" + _root.link].gotoAndPlay("s1");

             

            I'm assuming that that's either the rollover actionscript, or the actionscript to load the corresponding page. I don't want the corresponding page to load, I'd like to link the movieclip to a URL.

            • 3. Re: OnClipEvent
              siremorganmedia Level 1

              This is what I have now. The link works, but the rollover effect doesnt. I've been trying to fix this ALL day....any suggestions?

               

              onClipEvent (load)
              {
                  num = 2;
              this.onPress = function () {
              getURL("http://www.medicalconsumers.org","_blank");
                     }
              }

              • 4. Re: OnClipEvent
                Ned Murphy Adobe Community Professional & MVP

                You don't have any rollover code in anything you've shown, so it's not surprising if it doesn't work.

                 

                mc.onRelease = function(){
                    getURL("www.mysite.com", "_self");
                }

                 

                mc.onRollOver = function(){
                    // do something
                }