A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Animation Run After Release

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    6

    Animation Run After Release

    How would you run an animation after a button has been released?

  2. #2
    Senior Member
    Join Date
    Jul 2005
    Posts
    692
    on(release){
    _root.mc.play();
    }

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    6
    what exactly is _root.mc? I've never programmed in flash, just played with the animation.

  4. #4
    Junior Member
    Join Date
    Oct 2005
    Location
    Denmark
    Posts
    5
    Hi

    I would like to know more about this, too. I have the same problem.

    Maybe some helpfull person can tell us WHERE to place the "roll out" movieclip. Inside in the button timeline or....?

    I don't know about play.mc either, but a little more info would help us carry on experimenting - and learning....

    Thanks!

    Best regards
    Doris Karloff

    ----------------------------------------------------------------------- "It's alive!"

  5. #5
    Junior Member
    Join Date
    Oct 2005
    Location
    Denmark
    Posts
    5
    OK - I needed to find out myself, so I'll just as well share it with you:

    Instead of making a normal button you should make a movieclip with whatever animation you like both for the over and the out state. On top of the movieclip you place an invisible button (fill only the HIT-state).

    See my example, where text grows bigger when you put your mouse over and smaller when you take your mouse away.

    In the movieclip timeline I have the whole animation. From keyframe 1 to 10 the text grows bigger. In keyframe I have a stop-action to prevent the movie from running further. And then from keyframe 10 to 15 the text tweens back to the original size.

    I have named the movieclip instance MCwebdesign and it is controlled by an invisible button. The script for the button is:


    on (rollOver) {
    _root.MCwebdesign.gotoAndPlay(2);
    }

    on (rollOut) {
    _root.MCwebdesign.gotoAndPlay(11);
    }



    In the script for the rollover I go to frame 2 in the movieclip timeline to get away from the stop-action in frame 1. The same with the rollout, only now frame 11.

    So simple yet with a great effect – and that's how we like it – innit
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center