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 ***
mcpstevesAsked:
Who is Participating?
 
CalronConnect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.