AS 3.0 - making a movie clip into a clickable button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zb42
    New Member
    • Feb 2008
    • 3

    AS 3.0 - making a movie clip into a clickable button

    I have a _mc that I've added to the stage. On it's layers first frame I have this code that spins the _mc around and has some great effects:

    import fl.transitions. *;
    import fl.transitions. easing.*;

    TransitionManag er.start(img4_m c, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut} );
    TransitionManag er.start(img4_m c, {type:Rotate, direction:Trans ition.IN, duration:30, easing:Strong.e aseInOut, ccw:false, degrees:720});
    TransitionManag er.start(img4_m c, {type:PixelDiss olve, direction:Trans ition.IN, duration:2, easing:Regular. easeIn, xSections:10, ySections:10});
    TransitionManag er.start(img4_m c, {type:Fade, direction:Trans ition.IN, duration:4, easing:Strong.e aseOut});
    TransitionManag er.start(img4_m c, {type:Photo, direction:Trans ition.IN, duration:4, easing:None.eas eNone});

    This works great but, when that _mc comes to rest - I want it to be clickable.
    I went and tried to put code that would make this clickable and put it in the same frame - but, then my _mc wouldn't spin. Then I put the code on the first frame of the actual _mc and it did the same thing.

    Why does the code to make it clickable cancel out the code that makes it spin?
    What's the best way to do this? ( I want it to spin and then be able to click on it)

    Big Thanks,
    zb
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    #2
    Originally posted by zb42
    I have a _mc that I've added to the stage. On it's layers first frame I have this code that spins the _mc around and has some great effects:

    import fl.transitions. *;
    import fl.transitions. easing.*;

    TransitionManag er.start(img4_m c, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut} );
    TransitionManag er.start(img4_m c, {type:Rotate, direction:Trans ition.IN, duration:30, easing:Strong.e aseInOut, ccw:false, degrees:720});
    TransitionManag er.start(img4_m c, {type:PixelDiss olve, direction:Trans ition.IN, duration:2, easing:Regular. easeIn, xSections:10, ySections:10});
    TransitionManag er.start(img4_m c, {type:Fade, direction:Trans ition.IN, duration:4, easing:Strong.e aseOut});
    TransitionManag er.start(img4_m c, {type:Photo, direction:Trans ition.IN, duration:4, easing:None.eas eNone});

    This works great but, when that _mc comes to rest - I want it to be clickable.
    I went and tried to put code that would make this clickable and put it in the same frame - but, then my _mc wouldn't spin. Then I put the code on the first frame of the actual _mc and it did the same thing.

    Why does the code to make it clickable cancel out the code that makes it spin?
    What's the best way to do this? ( I want it to spin and then be able to click on it)

    Big Thanks,
    zb
    What does your button Timeline look like.
    and what are your actions for the button look like.

    nomad

    Comment

    • zb42
      New Member
      • Feb 2008
      • 3

      #3
      Thanks for the reply -
      The current state of the code is here. I have it listed in the first frame of the layer on which the movie clip 'img4_mc' resides.

      zb
      ++++++



      import fl.transitions. *;
      import fl.transitions. easing.*;

      TransitionManag er.start(img4_m c, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut} );
      TransitionManag er.start(img4_m c, {type:Rotate, direction:Trans ition.IN, duration:30, easing:Strong.e aseInOut, ccw:false, degrees:720});
      TransitionManag er.start(img4_m c, {type:PixelDiss olve, direction:Trans ition.IN, duration:2, easing:Regular. easeIn, xSections:10, ySections:10});
      TransitionManag er.start(img4_m c, {type:Fade, direction:Trans ition.IN, duration:4, easing:Strong.e aseOut});
      TransitionManag er.start(img4_m c, {type:Photo, direction:Trans ition.IN, duration:5, easing:None.eas eNone});

      function centerClick(eve nt:MouseEvent): void
      {
      var request:URLRequ est = new URLRequest("ind ex.cgi");
      navigateToURL(r equest, "_self");
      }
      img4_mc.buttonM ode = true;
      img4_mc.addEven tListener(Mouse Event.CLICK, centerClick);

      Comment

      • zb42
        New Member
        • Feb 2008
        • 3

        #4
        Well, I solved my problem.
        In the post above, the linkage script is pretty much correct
        for making a mc clickable to a url in AS3.

        But, it is extremly important to remember the little
        'import flash.net' thingy at the top of your script.

        zb42

        Comment

        Working...