Jump to content
Search Community

killAll made private

eigenface test
Moderator Tag

Recommended Posts

Looks like in the latest v11, killAll has been made private. I use that for everything, all of which would now have to be changed. It's a very convenient method for projects with both tweens and delayed calls when you just want to reset the entire state and start over. For whatever it's worth, here's 1 vote for keeping killAll public.

Link to comment
Share on other sites

Yeah, I wrestled with that one a little, but in order to be consistent with the timelines (which use stop() to be consistent with Flash's implementation of MovieClip timelines), I figured stopAll() is better. stop() and stopAll() instead of stop() and pauseAll(). Make sense? And I considered renaming "paused" to "stopped" but it seemed cumbersome. "paused" makes more sense as a property, no? Feel free to make suggestions. v11 is a MAJOR update and I want to get all the big changes out of the way now so that I don't have to do it later.

Link to comment
Share on other sites

It's confusing for stopAll to control paused - pauseAll should control paused, or stopAll should control stopped. In isolation, changing pauseAll to stopAll confuses as much as it clarifies.

 

To my taste, paused and stopped are both cumbersome because they're negative - there should be a property called "playing" instead. Ideally, MovieClips, timelines, and tweens should all share naming conventions. They should all use forms of "play" and "stop" for method and property names - resume and resumeAll should be play and playAll, restart should be replay, etc.

 

If you don't want to go that route, it seems okay to use different naming conventions for MovieClips/timelines versus tweens - MovieClips/timelines stop and play, but tweens pause and resume. The idea of tweening is conceptually distinct from the idea of grouping or sequencing tweens.

Link to comment
Share on other sites

It seems okay to use different naming conventions for MovieClips/timelines versus tweens - MovieClips/timelines stop and play, but tweens pause and resume. The idea of tweening is conceptually distinct from the idea of grouping or sequencing tweens.

 

I'd have to disagree. One of the core considerations in v11 was making all these objects (tweens and timelines) share a common base class so that they're all tweenable and can be tucked into timelines (yes, you can nest timelines within timelines within timelines). So I'm definitely opposed to having tweens use pause() while timelines use stop().

 

I considered replay() instead of restart(), but again, restart() seems more intuitive because it has a stronger connotation of beginning again.

 

You said "play" and "playAll" should be "resume" and "resumeAll" but that definitely shouldn't be the case because play() always sets the orientation to forward (if a tween is reversed, play() will make it go forward) whereas resume() doesn't alter the orientation (so if a tween is reversed and paused, resume() will make it resume playing in reverse). So play() and resume() are functionally distinct. I think the only question here is how to handle pause vs. stop because those are functionally equivalent.

 

Thus far I'm leaning towards sticking with using stop() for the method to be consistent with Flash's implementation for MovieClips, but keep paused as the property because just like restart() vs. replay(), it strikes me as more intuitive (although I don't feel as strongly about paused/stopped as I do about restart/replay). I'm open to having my mind changed, though.

Link to comment
Share on other sites

Glad to see pauseAll is back. That makes my life easier.

 

I noticed something odd, though. For killAll, tweens and delayedCalls both default to true, but for pauseAll and resumeAll, tweens defaults to true and delayedCalls default to false. I'd prefer if tweens and delayedCalls both default to true for all 3 methods. TweenMax has the word "tween" in its name, but it is de facto both a tweening and timing utility, and "all" should mean "all".

Link to comment
Share on other sites

Just as an update on the stop()/pause() thing, I chatted with Grant (Skinner) about it and we came to the conclusion that it'd be best to have pause() be the consistent mechanism to...um...pause tweens/timelines, but in order to maintain consistency with Flash's MovieClip.stop() and MovieClip.gotoAndStop(), those methods were left in TimelineLite and TimelineMax. So stop() does the same thing as pause() in the timeline classes, and they are BOTH available. tweens, however, only have pause().

 

Anyway, about the pauseAll() and resumeAll(), I suppose that's not a bad idea to change the default. The reason I didn't initially is because a lot of people rely on delayedCall() to trigger various code throughout their app, and it's distinct from tweens. I wanted to avoid a situation where pauseAll() was called, and then their functions never get called and they're baffled as to why. But I'll consider making that change in the next rev. Thanks for the suggestion.

Link to comment
Share on other sites

You're welcome. I have another one, if you want to further clean things up. You got rid of killAllTweens and killAllDelayedCalls in favor of keeping killAll public. You could also get rid of pauseAll and resumeAll in favor of making changePause public. In both implementations, the first 2 methods simply call the 3rd. Although, changePause is an odd method name. I often use a convention like

 

enableInput(enable:Boolean = true)

 

where the method name is "do something positive", and by default it does just that - enableInput() - or you can pass an argument to have the opposite effect - enableInput(false). Similarly, in place of pauseAll, resumeAll, and changePause, you could have a single method

 

pauseAll(pause:Boolean = true, tweens:Boolean = true, delayedCalls:Boolean = true)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...