PDA

View Full Version : gotoAndStop not working?


MonsterCheese
08-24-2007, 10:07 AM
Hey, i'm making a game with alot of scenes (64 so far, not done yet)
And in one of the scenes your moving a character to find out what your lesson is. And i want it to go to a certain Scene (#64) when a hitTest turns out true.

onClipEvent(load) {
if (_root.player.hitTest(_x, _y, true)) {
_root.gotoAndPlay("Scene 64", "DT");
}
}


That's what i'm currently using on my MovieClip for this NPC. (player = moveable char, ("Scene 64", "DT"); refers to go to the frame labeled DT in Scene 64)

I've also tried without _root. and using the frame number. But it's still not working :mad:

Also, i've tried a trace and it worked.

Noct
08-24-2007, 02:43 PM
Don't path a gotoAndStop/Play if you're targeting a scene, using a scene name is already telling it to look to the main timeline.
gotoAndPlay("Scene 64", "DT");

If you want to path it to the root, just use the frameName.
_root.gotoAndPlay("DT");
As long it is a unique frame name the scene information is not needed.
(Which is a good idea over all anyways)