-
Hittest Help
I'm trying to make a hit test where if your square touches the finish square it goes to the next frame which says, "You Win"
The actions for the square are:
Code:
onClipEvent (enterFrame) {
if (this.hitTest(_root.finish)) {
gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_y -= 10;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.DOWN)) {
_y -= -10;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= 10;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.Right)) {
_x -= -10;
}
}
The movement of the square works fine but when it touches finish it doesn't do anything.
SWF: http://www.t762.com/swf/hittest.swf
FLA: http://www.t762.com/swf/hittest.fla
Thanks,
Josh
-
_global.chosenson="flash";
Repaired!
I commented the script so you will know what changes I made and why/
Good Luck
If you have a question, need some help, email me: chosenson
It's always the simplest things that escape the complex mind!
always be just
-
Moderator
onClipEvent (enterFrame) {
if (this.hitTest(_root.finish)) {
_root.gotoAndStop(2);
}
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|