|
-
hittest with nested movieclips
I have a lot of nested movie clips. For some reason someone at one point told me it was a good idea.
I can't seem to get hittest to work. Any help is appreciated... Can you even hittest movies clips inside different movie clips?
This is my code:
Code:
for(var x=0;x<=5000; x++){
if(this.hitTest(_root.jet, _root.environment_mc.environment.bombSpawn_mc.flying_mc.bigBomb_mc)) {
trace("Collision Detected");
} else {
trace("No Collision");
}
};
-
I tried putting the hittest code in the flying_mc movieclip and that doesn't work either...
Code:
if(this.hitTest(_root.jet, this.bigBomb_mc)) {
trace("Collision Detected");
} else {
trace("No Collision");
}
Why doesn't this work?
-
Here, this one should be easy for anyone thats worked with hittest before. I made the file really really simple. I am trying to hit test the jet and flying_mc.
This is how I am writing it:
Code:
this.onEnterFrame=function(){
if(this.jet,hitTest(_root.flying_mc)) {
trace("Collision Detected");
} else {
trace("No Collision");
}
}
Please help
-
I'm getting somewhere... I know have this:
Code:
onClipEvent (enterFrame) {
if (hitTest(_root.flying_mc.bigBomb_mc)) {
trace("Collision Detected");
} else {
trace("No Collision");
}
}
That is on the jet movieclip. It works but only on the original bomb that the other ones spawn from. How do I hittest the duplicates?
-
Found this recent thread:
http://board.flashkit.com/board/showthread.php?t=688580
I don't understand the arrays though. I'm new. Could someone please explain?
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
|