PDA

View Full Version : Controlling a Collapsing Menu Animation with Actionscript


apprentice
02-18-2002, 10:17 PM
I'm having a problem getting a dropdown menu (a MC that contains both dropdown/collapsing animations) to animate a collapse when a user clicks on a different menu button. I realized that I couldn't simply attach this to the other button:

on (release) {
_root.button2.gotoAndPlay (frame_where_collapse_anim_begins)
}

..because the dropdown would appear even if it had not been initially dropped down. So I figured I needed to use an IF script that would check to see if the menu had already been dropped down. I tried this but it didn't work:

on(release) {
if(_root.menuanimation=19) {
_root.menuanimation.gotoAndPlay(20);
}
}

Frame 19 refers to where I stopped the dropdown animation. Frame 20 is where the collapse animation begins.

Could somebody be kind enough to check this or maybe refer me to a downloadable resource or tutorial I might read? Thanks in advance.

Billy T
02-19-2002, 02:14 AM
when you say collapse do you mean when the menu goes back up?

try

on(release) {
if(_root.menuanimation._currentframe==19) {
_root.menuanimation.gotoAndPlay(20);
}
}

apprentice
02-19-2002, 04:53 AM
Yes, collapse, meaning it goes back up.... and of course it works!! Thanks, BT, appreciate it.