Jump to content
Search Community

jdoleary

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by jdoleary

  1.  

    overwrite : String (or integer) - Controls how (and if) other tweens of the same target are overwritten. There are several modes to choose from, but "auto" is the default (although you can change the default mode using theTweenLite.defaultOverwrite property):

    • "none" (0) (or false) - no overwriting will occur.
    • "all" (1) (or true) - immediately overwrites all existing tweens of the same target even if they haven't started yet or don't have conflicting properties.
    • "auto" (2) - when the tween renders for the first time, it will analyze tweens of the same target that are currently active/running and only overwrite individual tweening properties that overlap/conflict. Tweens that haven't begun yet are ignored. For example, if another active tween is found that is tweening 3 properties, only 1 of which it shares in common with the new tween, the other 2 properties will be left alone. Only the conflicting property gets overwritten/killed. This is the default mode and typically the most intuitive for developers.
    • "concurrent" (3) - when the tween renders for the first time, it kills only the active (in-progress) tweens of the same target regardless of whether or not they contain conflicting properties. Like a mix of "all" and "auto". Good for situations where you only want one tween controling the target at a time.
    • "allOnStart" (4) - Identical to "all" but waits to run the overwrite logic until the tween begins (after any delay). Kills tweens of the same target even if they don't contain conflicting properties or haven't started yet.
    • "preexisting" (5) - when the tween renders for the first time, it kills only the tweens of the same target that existed BEFORE this tween was created regardless of their scheduled start times. So, for example, if you create a tween with a delay of 10 and then a tween with a delay of 1 and then a tween with a delay of 2 (all of the same target), the 2nd tween would overwrite the first but not the second even though scheduling might seem to dictate otherwise. "preexisting" only cares about the order in which the instances were actually created. This can be useful when the order in which your code runs plays a critical role.

    But Carl and Jack can clarify this for you :)

     

    Jonathan,

     

    I tried using "overwrite" to correct the problem but it still didn't work.  Also, I don't think this is a case of "immediate render" confusion because I'm using fromTo and not just from, so the object's values when the function is called are irrelevant.

  2. Hi All,

     

    Sorry for the broken pen, I cleaned it up before posting and stupidly forgot to test it again.

     

    @Jonathan, @Jack,
    This is kind of what I assumed was going on.  I guess "intuitive" can mean different things in different examples.  I just so happened to expect that a call to "set" would overwrite any previously called tweens on these objects, but I can see why you want it that way.

    • Like 1
  3. I have found what seems to be an inconsistency when cancelling tweens.  Please see the attached codepen for a demo.

     

    Usual Behavior:  When TweenMax.set is called while another tween is running, the already running tween is cancelled (when they affect the same values)

     

    The Possible Bug:  When that initial tween is called, but it hasn't "started", the cancellation does not occur and TweenMax.set is effectively called before the former tween even though it occurs after.

     

    Edit:  I updated the codepen to work and to make more sense.

    See the Pen wMKbqM?editors=101 by jdoleary (@jdoleary) on CodePen

×
×
  • Create New...