Forums

ForumsProgramming Forum

Hittesting multiple movie clips with the same identifier? (AS2)

Posted Dec 16, '13 at 7:46pm

arobegamr

arobegamr

119 posts

Have you tried a trace function outside of the enterFrame function?

 

Posted Dec 16, '13 at 8:19pm

mightybob

mightybob

348 posts

I have a trace above the onEnterFrame thing, it traces it. It also traces if I put it after the onEnterFrame is over.

 

Posted Dec 16, '13 at 8:22pm

mightybob

mightybob

348 posts

I have no clue what this had to do with everything, but I removed another enterFrame in a different frame and all works great! Thank you everyone, you were very helpful!

 

Posted Dec 16, '13 at 8:33pm

arobegamr

arobegamr

119 posts

A single clip can only have one onEnterFrame function.

See, what you are doing when you say onEnterFrame = function() { is specifying a function called onEnterFrame, which is reserved by flash and called each frame.

Say you had two functions called gameLoop() and gameOverLoop(), and you did the following:

onEnterFrame = gameLoop;
onEnterFrame = gameOverLoop;

Flash replaces the original onEnterFrame (gameLoop), with the new one (gameOverLoop).

It's the same as any variable or method, when you specify a new one, it overwrites the old one.  A very good thing to know for the future.

Keep at it.  You'll learn the common mistakes and how to avoid them.

 
Reply to Hittesting multiple movie clips with the same identifier? (AS2)

You must be logged in to post a reply!