• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Does each timeline keyframe = new object?

Guest
Apr 14, 2012 Apr 14, 2012

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

TOPICS
ActionScript

Views

566

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2012 Apr 14, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 14, 2012 Apr 14, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2012 Apr 14, 2012

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines