Copy link to clipboard
Copied
Hi guys, starting to test my game and realizing I may have made a huge error in the design. I have a "hit tester" MovieClip in the timeline with hundreds of keyframes (all given the same exact instance name), moving it along with the character's animation. I'm debugging and realizing thousands of instances are being created somewhere. Is each keyframe of a MC instance in the timeline the equivalent of coding "mc1:MovieClip = new MovieClip()" ? This problem is really bringing my project to a stand still so any help is incredibly appreciated! Thanks |
Copy link to clipboard
Copied
yes.
just because those movieclips have the same instance name or reference name, doesn't make them the same movieclip.
Copy link to clipboard
Copied
Thanks kglad
So is there a way to get flash to NOT create a new object at each keyframe? Just re-use the same object. I've read a few different theories on this.
If I make sure on every single keyframe in the timeline this object is there with same instance name, does that help? I read that any keyframes in between (on other layers or not) will result in a new object being created.
Copy link to clipboard
Copied
create the initial keyframe that will contain your movieclip. assign its instance name. now add as many keyframes as you like (AFTER that intial keyframe). do not remove/replace your movieclip on any keyframe or thereafter you will lose your movieclip reference.