[AS2] Issue HitTest and gotoAndStop

5 posts

Flag Post

Apparently, I’ve been Googling this problem and I can’t seem to make it work.


onClipEvent(enterFrame){
	if(_root.char.hitTest(this)){
		trace("LALALALA");
		_root.gotoAndPlay("Scene 1", "Vampire");
	}
}

The condition is working as I can see the String “LALALALA” at my Output Window.

 
Flag Post

http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00000566.html

You can use the scene parameter only on the root Timeline, not within Timelines for movie clips or other objects in the document.

Solution: code on the main time line

 
Flag Post
Originally posted by NineFiveThree:

Solution: code on the main time line

Also don’t use scenes. Ever. They do awful nasty things to your code.

 
Flag Post

It’s actually on one Scene.
Just thought frame labels required the Scene Name.

 
Flag Post
Originally posted by chaos548:

It’s actually on one Scene.
Just thought frame labels required the Scene Name.

Nope. gotoAndStop() is overloaded four ways:

1) int
2) string
3) string, int
4) string, string

3 and 4 are for changing scenes at the same time.