I'm not entirely sure if this is a suggestion, or should rather be a bug report, but I find myself frequently wanting to use MovieClip in a slightly unconventional way.
Instead of creating my Sprite instance as a MovieClip from the beginning, thus requiring the timeline to be established when calling .new(), I would like to be able to create a separate MovieClip from within the Sprite that would then control the Sprite when played.
This seems to work right now in certain cases. I'll create a new MovieClip, give it an object of "self", play the animation, and all is well. In other cases, however, the clip will stop part way through unless I add the MovieClip to the stage hierarchy, thus creating another instance of "self", which I don't want to do.
Perhaps there's a simple work-around that I'm missing?
Comments
However, if any other MovieClip animations are currently playing, the line...
Does that make sense?
Or you can check in onAddedToStage function Event.COMPLETE if dispatched then play if not MovieClip:gotoAndPlay(frame) .
(
When a MovieClip object finishes it playing (by reaching its final frame or a frame with stop action),
it dispatches an Event.COMPLETE event.
)
But what will happen in multiple instances have no idea, haven't tried it just came to me:D
for this purpose I usually use GTween:
https://github.com/gideros/GTween
More info:
http://appcodingeasy.com/Gideros-Mobile/Gideros-GTween-with-easing
It can actually tween any property that can be passed to set method, so you can write your custom set methods for your classes and tween anything you would want:
http://www.giderosmobile.com/forum/discussion/980/tween-anything/p1