notarysojac
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by notarysojac
-
-
When I tried to perform a fromTo tween, the onComplete:myFunction was executed as soon as the tween became active and not after the tween had run its course, as I had expected.
According to the existing documentation reference which was not immediately obvious to me, if you're going to do things like add references to onComplete, then you need to associate all such references with the to portion of the Tween declaration - not the from part.
WRONG:
TweenMax.fromTo(dispObj, tween_duration, { alpha:fromAlpha, ease:tween_func, delay:tween_delay, onComplete:tweenCompleted, onCompleteParams:[nexttweenID] }, { alpha:toAlpha });
CORRECT:
TweenMax.fromTo(dispObj, tween_duration, { alpha:fromAlpha }, { alpha:toAlpha, ease:tween_func, delay:tween_delay, onComplete:tweenCompleted, onCompleteParams:[nexttweenID] });
Creating An EASE function reference
in GSAP (Flash)
Posted
Maybe this will save somebody some time - and help to keep their code more manageable.
In an ever vigilant effort to avoid embedded magic numbers in my code, and, in
consideration of the fact that STRINGS are often just another form of magic number,
I created a function to return a reference that could be used with calls to the Greensock Tweens.
As my ActionScript is always data-driven from an XML file, I embed the easename and easekind
in the XML - then use that to create the function reference pass into the Greensock Tween.
The advantage here is that I can change behavior without the need to recompile my SWF app.
Of course, there's much more contained in the real XML file - the contents shown here are limited for clarity.
When I need to create an easement reference to a Tween - it might look something like shown below.