PDA

View Full Version : _root.main._currentframe help



kev
October 14th, 2003, 06:04 PM
(Flash 5)

Hi all is there a way to have instead of this code which is in a button:

if (_root.main._currentframe == 25) {
tellTarget ("_root.main") {
play ();
}
if (_root.main._currentframe == 55) {
tellTarget ("_root") {
gotoAndPlay (35);

}
}



I can see why it does not work beause I have told that mc to play and the action to see if it has reached frame 55 was actioned before it reaches frame 55.

I need something like this:

if (_root.main._currentframe == 25) {
tellTarget ("_root.main") {
play ();
}
when (_root.main._currentframe == 55) {
tellTarget ("_root") {
gotoAndPlay (35);

}
}



So basically is there action script to say, when an mc reaches a certain frame go and do something else from a button.

Hope it makes sense

Thanks

kev

jingman
October 15th, 2003, 03:28 PM
if(movieMC._currentframe == a){
buttonMC.gotoAndPlay(b);
}

kev
October 16th, 2003, 03:33 AM
thanks for the rply jingman.

Ok. I have sorted it out. had to use a series of listeners to keep check on things :)

one thing though can you have this command:

if (_root.main._currentframe == 25) {
tellTarget ("_root.main") {
play ();

}
}

Detect a range of frames, i.e frame 1 - 25?

Instead of repeating the above 25 times!

Thanks

kev
October 16th, 2003, 02:08 PM
Figured it :)

<= - equal or less!

cheers