PDA

View Full Version : Scripting movieclip to play at a certain point


Wai_TungLeung
01-04-2007, 07:14 PM
Hi, been resisting asking for help but alas, I give in. :confused:

I've got a fancy 2 colume navigation system, the second of is a movieclip with animation for collapsing when you click to go to a new section of the flash site and will then expand with new button options.

What should happen is that user clicks on link A
Actionscript triggers nav colume 2 to play its collapse animation
The main timeline then moves to frame nth where the new content is

The problem is that at this point I want the nav colume 2 on that frame to play it's expanding animation, but it doesn't. The code below is what I placed on my actionscript layer on the main timeline on the keyframe.
submenu.gotoAndPlay("expand");
stop();

It displays the menu at the correct point where I placed the label 'expand', but doesn't play the rest of the animation. I've messed around with other things such as onClipEvent (load) but I'm just getting it wrong.

Anyway please put me out of my misery with whatever simple solution it is, thanks in advance. :o

BernzSed
01-05-2007, 06:00 AM
Hmm, not sure.
I'll speculate.
Did you put "stop();" on the "expand" frame? Remember, when you gotoAndPlay() a frame, the code on that frame is executed before it moves on to the next frame.

Wai_TungLeung
01-05-2007, 11:09 AM
Well I sure feel beaten, the movieclip does have a "stop();" on the frame labelled "expand", obviously to stop it from playing when the "collapse" animation is played.

I took out the "stop();", but sadly the animation still refuses to play. :(

Everything seems to be alright, the labels are right, the instance names are correct, the address should be correct, yet the clip doesn't want to play!

EDIT:
I have managed to resolve the problem, though not really through the route I wanted. What I basically did was change the ordering of my animation, so the menu expanding would happen first and the collapsing happening second. Then at the expand label I took out the "stop();" so of course when the playhead moves to the new frame the movieclip plays instantly.