PDA

View Full Version : swapDepth/reverse animation



friggingmick
September 8th, 2006, 11:25 AM
See this example: http://www.templatemonster.com/flash-templates/8785.html

I figure I'll create a few tweened mcs with two stops (first and last frame) and set up them on the stage. And use the swapDepth function to swap the mc when rollover to swap the mc to highest depth and play the mc. I cannot find a good example function or better approach that will show how to reverse the mc's animation when rollout. Anybody care to point me to right direction, give me a function example, any tutorial or example file?

Much appreciated!

Jace

fluid_tw0
September 8th, 2006, 07:32 PM
i wouldn't be so sure about that "reverse" thing - from what i can spot, this site uses buttons with 2 stops and as such as:

on(rollOver) {
this.gotoAndPlay("over_animation");
}
on(rollOut) {
this.gotoAndPlay("out_animation");
}

but the main disadvantage of this method is, that animation isn't smooth if you take the cursor back, "over_animation" still plays... after taking the cursor it jumps (literally) to the other animation

i prefer to use another method - similar, but more "real" (to me at least:D)

it needs some scripting :-)

on (rollOver) {
over = true;
play();
}
on (rollOut) {
over = false;
play();
}
and this code goes to the buttons main timeline:

//for 1st stop
over ? null : stop();

//for 2nd stop
over ? stop() : null;