PDA

View Full Version : simple scene selection


corroded
09-18-2006, 08:32 PM
hi, i've been coding as for years now and yeah, sometimes i forget even the most basic things.

i have 3 scenes, intro, main, and pics.

the intro has some starting global variables and inits while the main has 2 textfilds(with some 'cheated' animation) pics contain more pics and more movieclips because i cant select scenes dynamically(gotoAndplay only accepts string literals for scene names, not variables)

anyway, the problem is this: at the end of thos movieclips, i put a code that made the playhead goto a frame on the pics scene:

_parent.gotoAndPlay("test");

in the frame named "test", i made a script:

gotoAndPlay("main", 1);

now the problem is, this code doesn't work. i tested it and the thing is, the movie loops from the beginning! So i put a stop in the test frame and voila, nothing happens anymore, meaning the playhead doesnt go to the main scene.

can anyone explain this?

also i tried something on the intro scene: on frame 1 of the intro scene, i have this code:

stop();
gotoAndPlay("pics","test");

it should theoreticaly go to the test frame of the pics scene right? but no. nothing happens.

am i missing something here? all i know is that gotoAndPlay(scene,frame); only works in the main timeline and the code IS in the main timeline. so what's wrong?

sunlis
09-22-2006, 08:52 PM
You have to use the number of the scene, regardless of it's name.
So if pics is your second scene, then replace "pics" with 2.
Hope this helps.

Sunlis