Hello capable members of ActiveDen. I might not deserve your help, but I was told not to simply give up. So I’m asking if maybe someone here can help me. I bought a greensock corporate membership about a month ago almost. I haven’t developed anything since I got it. I can’t figure out how to use the greensock tweening engine. To me, its complicated. You have to “activate” plug-ins just to change the colors of an object, quite complicated. I tried looking for documentation about how to simply animate an object with a x and y coordinate tween, but haven’t seen a lick of information about it. So… how does anyone know how to use this tweening engine, greensock’s TweenMax or TweenLight?
P.S. By the way, I can’t open up all of the example.swf files because I have only CS3 .
hey shucks get with http://activeden.net/user/DaniMun she uses tween im sure she will help you if not busy doing other things
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 50 and 99 users
It’s really simple. Here’s a few basics.
TweenLite.to(mc, .75, {x:250, ease:Expo.easeOut})
TweenMax.to(mc, .75, {tint:0xffffff, onComplete:FIRE})
function FIRE { TweenMax.to(mc, .5, {removeTint:true}) }
TweenLite.from(mc, .5, {scaleX:0, scaleY:0, ease:Quad.easeOut, onStart:FIRE})
Those are some basics.
You can basically tween any property just put in in the {}. Most plugins don’t need to be activate using tweenmax, and you can use max and lite in the same doc no problem.
Let me know if this helps.
Actually, marcfolio those were answers to all of the questions I was going to ask. Thanks. But your examples so arise a few more questions. What is the difference between using TweenMax.to and TweenMax.from?
Aw_Shucks said
Actually, marcfolio those were answers to all of the questions I was going to ask. Thanks. But your examples so arise a few more questions. What is the difference between using TweenMax.to and TweenMax.from?
When you use TweenMax.to function, then the object that you are tweening, tweens from its current properties(x,y, alpha, etc.) to the new properties you give in the function.
Like if I say:
TweenMax.to(object, 1, {x: 200, y: 200, alpha: 0.5, easing:Expo.easeInOut});
Then, the “object” will animate from its current position to its new position/alpha in 1 second.
Now, when you use TweenMax.from function, then the object that you are tweening, tweens from the new properties you give in the function to its current properties.
So, if I say:
TweenMax.from(object, 1, {x:500, y: 500, alpha: 0, easing:Expo.easeInOut});
Then, the object will first have its alpha as 0, its x and y coordinates as 500, and then will animate to its actual/current/default position/alpha in 1 second.
I see. Thanks, KamilWaheed.
Aw_Shucks said
I see. Thanks, KamilWaheed.
My pleasure. 
But still, I would recommend you to go and start experimenting anything that comes to your mind. That’s the best way to learn. If you aren’t sure about the difference between TweenMax.to and TweenMax.from, just experiment and see the difference for yourself.
- Author had a Free File of the Month
- Microlancer Beta Tester
- Beta Tester
- Contributed a Tutorial to a Tuts+ Site
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Item was Featured
- Author was Featured
- Referred between 1 and 9 users
Ben, TJ is right, I’d be delighted to help you out on this one!
In addition to what Marc and Kamil explained, the most noticeable difference between TweenLite and TweenMax is the default capabilities that each tween engine possesses. By default I mean out of the box, without the need of activating any plugin. So basically if you want to tween a “regular” property such as x* or *rotationY, TweenLite will do the job easily. Since you might be concerned about the file size of the swf, there would be no benefit from using TweenMax instead – TweenMax extends TweenLite, thus adding to the filesize. However, TweenMax is capable to do everything that Lite does, and more, such as tint, that is, colorize the DisplayDbject instance you need, add blur or dropShadow to it etc. That doesn’t mean Lite can’t do such “exotic” tweens, but it needs to “know” what each “exotic” tween is. You can easily “teach” TweenLite about each special tween does by simply activating the tween-plugin that’s responsible for the necessary tween property. Activating a necessary plugin is as easy as this:
TweenPlugin.activate( [TintPlugin, BlurFilterPlugin, DropShadowFilterPlugin] );
The benefit of activating plugins and using TweenLite over TweenMax is, you’re in control of which plugins are active and which aren’t, giving you full control over the file size of the swf. Plus, as long as you activate the plugin(s) once in your code, TweenLite is smart enough to remember the activation, so you don’t need to activate the plugin(s) again 
Does that make sense?
- United States
- Has been a member for 4-5 years
- Exclusive Author
- Author was Featured
- Sold between 50 000 and 100 000 dollars
- Item was Featured
- Contributed a Tutorial to a Tuts+ Site
- Author had a Free File of the Month
I know you come from Tweener land, so the syntax is very similar. In a basic tween, the two big differences are where the time is declared and also the easing. Here’s an example:
TweenLite.to(mc, 1, {x: 50, ease: Quint.easeOut});
Tweener.addTween(mc, {time: 1, x: 50, transition: “easeOutQuint”});
I like to set the default ease at the beginning, so you wont have to keep writing the ease every time:
TweenLite.defaultEase = Quad.easeInOut;
