Difference between revisions of "Tweener"

From Wikicliki
Jump to: navigation, search
Line 31: Line 31:
  
 
<pre>Tweener.addTween( this.parent.getChildByName('save_mc'), {x:430, delay:3, time:1,  transition:"easeOutBack"});</pre>
 
<pre>Tweener.addTween( this.parent.getChildByName('save_mc'), {x:430, delay:3, time:1,  transition:"easeOutBack"});</pre>
 +
 +
[[Category:Programming]]

Revision as of 03:45, 1 June 2009

Tweener is an actionscript class library which lets you make all sorts of amazing easing in and out animation effects.

My sample implemenation (very simple example)

import caurina.transitions.Tweener;



invest_mc.onRollOver = function () {
invest_mc.gotoAndPlay("open");
Tweener.addTween(save_mc, {_x:168.5, time:0.3, transition:"easeInOutExpo"});	
Tweener.addTween(protect_mc, {_x:58.5, time:0.3, transition:"easeInOutExpo"});	
};


invest_mc.onRollOut = function () {
	invest_mc.gotoAndPlay("close");
	Tweener.addTween(save_mc, {_x:376.4, time:0.3, transition:"easeInOutExpo"});	
	Tweener.addTween(protect_mc, {_x:266.5, time:0.3, transition:"easeInOutExpo"});	
}



Referencing the parent / main timeline

Tweener.addTween( this.parent.getChildByName('save_mc'), {x:430, delay:3, time:1,  transition:"easeOutBack"});