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

Accessing Timeline Tweens associated with a MovieClip?

Engaged ,
Aug 08, 2012 Aug 08, 2012

Copy link to clipboard

Copied

I'm trying to create a function to take a snapshot of the state of all objects on the stage for later restoration. It works great for movieclips, text boxes, etc but now I've hit Tweens and MotionTweens and I'm stumped. These are not programatically created tweens, but rather ones created on the timeline.

I see that theoretically, if I could figure out whether there's a tween associated with an object, I could call the position function to find out how far along it is in playing, but that's only if I can figure out how to get to it from the movieclip, which so far I'm stumped on.

Is there any simple way to do this?

Thanks in advance,

Eric.

TOPICS
ActionScript

Views

391

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

correct answers 1 Correct answer

Engaged , Aug 09, 2012 Aug 09, 2012

OK, I accomplished a half-assed workaround.

It turns out that while a Tween always reports back a frame of 1, if you actually put frame labels on, those get reported back correctly. (Go figure!)

So in my save function, I essentially inserted:

if( thisNode.currentFrameLabel !== null ) {

     xmlChild.frame = thisNode.currentFrameLabel;

} else {

    xmlChild.frame = thisNode.currentFrame;

}

which lets the restore code still function either way, restoring the Tween as it should.

We still have to go back thr

...

Votes

Translate

Translate
Engaged ,
Aug 09, 2012 Aug 09, 2012

Copy link to clipboard

Copied

LATEST

OK, I accomplished a half-assed workaround.

It turns out that while a Tween always reports back a frame of 1, if you actually put frame labels on, those get reported back correctly. (Go figure!)

So in my save function, I essentially inserted:

if( thisNode.currentFrameLabel !== null ) {

     xmlChild.frame = thisNode.currentFrameLabel;

} else {

    xmlChild.frame = thisNode.currentFrame;

}

which lets the restore code still function either way, restoring the Tween as it should.

We still have to go back through and verify that all manual Tweens are built with frame labels on each keyframe, but close enough for now.

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