PDA

View Full Version : Paths to Scenes?


Metrov 8
03-07-2001, 01:47 AM
I have a Main [level0] movie with (6) scenes.

My Menu .swf is loaded into level 9. I'm trying to use telTarget commands executed from Menu movie buttons to go to the various scenes. Example....

on (release) {
tellTarget ("_level0") {
gotoAndPlay ("Services", 1);
}
}

But it's not working. Is it possible to use telTarget to go to a 'scene' in a different level?

Thanks, Metrov

Jesse
03-07-2001, 02:02 AM
Yes, and that code is perfectly acceptable... dunno why it's not working.

Tried:

_level0.gotoAndPlay ("Services", 1);

?

Cheers

Jesse

Metrov 8
03-07-2001, 02:27 AM
I tried using labels instead of frame #s and now it works fine. I'd heard that Flash sometimes has trouble with frame #'s, I think especially if it's the first frame, and there is only one frame in a scene. So there you have it. Thanks, M

apprentice
02-18-2002, 01:34 AM
Found this thread through the 'search' feature as it pertained to my dilemna. I'm new to actionscripting and this is what I've noticed:

I ran into the same issue of not being able to get this piece of scripting to work between scenes. Then I realized that the script (on the buttons) I tweaked in the new scene was changing on a global level BECAUSE my buttons were placed inside a MC (that was then duplicated in the new scene). Regardless, the button script (used in both scenes) is still pointing to the original scene, so technically it should work, but it doesn't, not even if there's only one scene. I don't know why it's happening, but here's what is/isn't working:

This does not work
on (release) {
_root.gotoAndPlay ("Scene1" , 7);
}

This does work, just that I can't specify the scene
on (release) {
_root.gen.gotoAndPlay (7);
}

In anycase, I guess I'm realizing that it probably isn't the best idea for me to build a site with 5 more or less duplicate scenes, but it would be nice to know that I could do it if needed. Anyone have any further thoughts on this?

apprentice
02-18-2002, 06:58 AM
Actually, I failed to mention that I did not get the second script to work across multiple scenes, only with one scene.

gwd
02-18-2002, 08:00 AM
//this should be work:

on (release) {
gotoAndPlay ("Scene2" , 7);
}


//this will be never work:


on (release) {
_root.gotoAndPlay ("Scene1" , 7);
}


//the problem of your script is the "_root"

Ricod
02-18-2002, 08:08 AM
Flash has troubles with scenes. Kinda depends on different factors. Too get around this, label the frame of the scene u want to jump to, and target this lable. For instance, if u label the 1st frame of scene 2 as "someFrame", u can just code :
_level0.gotoAndPlay("someFrame");

But if u really wanna use numbers, u'll need to take the frame number and add the frames in front of it (like frame 7 in scene2, with 50 frames in scene 1, then it can be targetted as frame 57, but this is a bit awkward, cuz if u add a frame in scene 1, u'll need to change the gotoAndPlay too).