PDA

View Full Version : if (_root.b = Frame1) Command?



kev
October 3rd, 2003, 05:35 PM
Just a quick one, ok I have two mc's (which contain a button)on the _root. Each MC has 30 frames. When I press MC1 on the main stage the MC1 moves to frame 15 and stops, but I need to check what frame MC2 is at, if it is at frame 1 then I don't want any commands to effect it, if it is at frame 15 I want it to play ();

I thought this would work -



if (_root.mc2 = Frame1) {
stop ();
} else {
play ();
}


But it does not, anyone know the command for this?

Thanks

lostinbeta
October 3rd, 2003, 06:34 PM
if (targetClip._currentframe == 15){
//do this
}

_currentframe is the property to check what frame in the timeline the clip is on.

== is compare 2 values and see if they are equal.

So basically it says that if the currentframe of the target clip is 15, then do what you need to do.

kev
October 3rd, 2003, 07:05 PM
lostinbeta, Thanks, saved a long night for me, again :)

Take care