PDA

View Full Version : Change scenes from within a movie clip



vegetable420
May 10th, 2002, 12:12 AM
I'm writing a simple game with Flash and I need to change the scene from inside a movie clip instance. I know how to change scenes with a button, but I can't seem to get the scene to change when certain criteria are met. For example inside a movie clip object I have this:

if(_root.score > 100)
_root.gotoAndPlay("Congrats", 1)

but the scene doesn't change. What am I doing wrong?

upuaut8
May 10th, 2002, 03:20 AM
use frame labels, instead of frame numbers.

Iammontoya
May 13th, 2002, 09:22 PM
I dont see where you're telling it to change scenes.

upuaut8
May 13th, 2002, 11:39 PM
He renamed his scene to be "congrates", I'm assuming.

I didn't really explain well the frame label thing either so I've opted to make another reply. :)

The deal with scenes is this... in a final production the frame numbers just extend from 1 to whatever no matter what scenes they run into .. I know that doesn't make a whole lot of sense.. it certainly confuses me.

To set a frame label, open your "Frame" panel. create a blank layer and where ever you would like a label for a goto statement, place a blank keyframe. Then with that frame selected, type in a frame label in the "Frame" panel.

then your goto statement would look something like

on(release){
gotoAndPlay("congrates","myFrameLabel");
}