Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

Movieclip: Play next 10 frames then go to another specified frame in same clip

I have a movieclip of a panel that slides up with a title on it. When you press another button that panel disappears and the movieclip of the new panel slides up. What I would like is for the original panel to slide down (when another button is pressed) before the next title panel slides up, not just disappear. Does anyone know the actionscript for this.

Thanks
Steve S.
*** advertising removed by Netminder, Site Admin ***
0
mcpsteves
Asked:
mcpsteves
1 Solution
 
CalronCommented:
Let's assume you have all these separate animations in one movieclip. YOu have to make sure that you add the following command at the end of the panel disappearing animation:

gotoAndPlay(_global.nextAnimation);


Then in the button that should slide out the first panel and then slide in the next panel you need to add this code:

on (release) {
  _global.nextAnimation = 25;  // this has to be the frame number of the new panel sliding in
  gotoAndPlay(50);        // the frame number of the animation of the panel sliding out.
}


Now if you have different panels that have different animations sliding out you will have to take two variables along:

_global.nextAnimation  for the animation of the sliding in
_global.lastAnimation  for the animation of the sliding out

YOu ill have to make sure that you set _global.lastAnimation to the correct frame number when your movie starts, but then you can change the aboce code to this and it will work as well:

on (release) {
   var last = _global.lastAnimation;  // important, else we overwrite this value when we still need it
  _global.nextAnimation = 25;  // this has to be the frame number of the new panel sliding in
  _global.lastAnimation = 35;  // the frame number of the sliding out of the new panel
  gotoAndPlay(last);        // plays the sliding out of the current panel
}
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now