You can also alter the Tween class (by creating an own version from, or
extending the mx.transitions.Tween Class) and make it possible to
disable. I have found this to be the most reliable way to get around the
problem, since stop(), or deleting the Tween will not always work for
some reasons.
//add a property:
private var enabled:Boolean = true;
//and two functions:
function disable():Void {
enabled = false;
setPosition = null;
}
function enable():Void {
enabled = true;
setPosition = doSetPosition;
}
And there you go, Tweens can be disabled.
/Eskil
Jack Doyle skrev:
I'm not sure about other tweening engines, but the one I wrote (TweenLite)
automatically overwrites tweens that affect the same object/MovieClip to
prevent collisions unless you flag it not to. I found that I almost always
needed it to overwrite existing tweens, so I made that the default behavior
but like I said, you have the ability to change that if you need to. See the
documentation at the top of the class file for instructions.
You can snag the class at:
http://www.greensock.com/ActionScript/TweenLite/
Good luck!
Jack Doyle
-----Original Message-----
Message: 8
Date: Fri, 3 Nov 2006 16:39:52 +0000
From: "Kevin Cannon" <[EMAIL PROTECTED]>
Subject: [Flashcoders] AS Tweening. Approach to prevent tween
clashing?
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=UTF-8; format=flowed
Hi All,
I've been building sites with laco's tweens for a good while.
Occasionally I've come accross problems when you click on buttons
really fast in sucession. If one item is still tweening you can end up
with unpredictable results.
Does anyone have any advise on what approach I can take to avoid that.
I'm real trouble figuring out what specifically is causing the
problem, even though I understand the general problem.
Has anyone any advice,
Thanks,
- Kevin
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
<http://www.eskilstina.com>
---eskilStina
------------------------------------------------------------------
Eskil Janson Mobil: +46 0735 31 68 52
Slupskjulsvägen 38 E-post: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
111 49 Stockholm Webb: www.eskilstina.com <http://www.eskilstina.com>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com