PDA

View Full Version : play 15 frames and change scene


darthnacho
08-30-2003, 03:49 PM
i need a button to do exact that. when u click the button it must play 15 frames and then go to other scene.

i can`t tell to go to other scene in the last frame because there are a lot of scenes and buttons that have to do the same.

5 buttons - 5 scenes - play 15 frames and then change the button-scene


send help!!!!!

Adrenaline
08-30-2003, 05:44 PM
it's recommended the you use frame label instead of scenes. So, this code is to go to a frame number or a frame label, but it can't be used to goto scenes.
place this code at the beginning of the timeline.:
_root.onEnterFrame = function () {
button1.onRelease = function() {
Frame = "YourFrameLabel"
}
button2.onRelease = function() {
Frame = FrameNumber
}
//etc.
}

place this code at the end of the timeline:

gotoAndPlay(Frame);

but if you have to use scene do this:
place this code on the timeline:
button1.onRelease = function() {
Frame = _root._currentframe+16;
gotoAndPlay(YOURNEXTFRAME);
_root.onEnterFrame = function() {
if (frame == _root._currentframe) {
gotoAndPlay("SCENE2", 1);
}
};
};
button2.onRelease = function() {
Frame = _root._currentframe+16;
gotoAndPlay(YOURNEXTFRAME);
_root.onEnterFrame = function() {
if (frame == _root._currentframe) {
gotoAndPlay("SCENE3", 1);
}
};
};
//continue for each button
in the above code i am guessing that you have a stop action before the 15 frames you want to play

Hope that helps