Right now if I use the 'play()' method on a MovieClip I first have to use the 'stop()' method when it has already played. I do that to reset the MovieClip to start over again. I think the right behavior should be to check first if the MovieClip is at the last "frame" (totalFrames) so that if you use 'play()' again it starts from the first "frame". Right?
I think MovieClip 'play' behavior should be adjusted a bit.
(7 posts) (5 voices)-
Posted 1 year ago #
-
And what will we do if we don't want to start over? In some cases playback should start from where it was paused.
Posted 1 year ago # -
I think you misunderstood ypmits, Elegar. If it is in the last frame, you cannot resume from where it is stopped, as it is already in the last frame.
I agree with Elegar. If I am not mistaking, Flash's default MovieClip works that way.
Posted 1 year ago # -
Flash movieclip loops by default.
Posted 1 year ago # -
MovieClip definitely loops by default. I tested this MovieClip behavior a long time ago and I'm pretty sure that if a MovieClip is finished (last frame) and you apply the play() method on it that MovieClip will automatically start playing again unless there is a stop() (or similar) method on the first frame, because then it will go to the first frame and stop.
Posted 1 year ago # -
To be sure I understand you correctly: when a non-looping movie clip reaches its last frame, it stops. Now, when you call 'play' again on that movie, you want it to restart right away, right?
Which would be done with the following change in the MovieClip's 'play' method:
public function play():void { if (mCurrentTime == mTotalTime) currentFrame = 0; mPlaying = true; }
I'm not sure if this is really more intuitive than the current behavior, though. Sometimes, you want to call play on the clip, no matter where it currently is in its lifetime, and *not* want to restart it right away. That would be harder to do, then.
But I might be persuaded of the contrary!
Any other opinions on that topic?
Posted 1 year ago # -
You do understand me correctly, and I agree with your last point that it would be harder to do, but a Flash-MovieClip behaves exactly in the way I said earlier, and I'm not saying Flash's default behavior is the right behavior but since you're mimicking Flash's methods in Starling I'm also assuming you're mimicking the behaviors those methods are acting upon. That's why I mentioned it. I guess in the end it's pretty trivial
Posted 1 year ago #
Reply
You must log in to post.