Difference between revisions of "Tweener"
From Wikicliki
| (2 intermediate revisions by the same user not shown) | |||
| Line 8: | Line 8: | ||
| − | <pre> import caurina.transitions.Tweener; | + | <pre>import caurina.transitions.Tweener; |
import caurina.transitions.properties.FilterShortcuts; | import caurina.transitions.properties.FilterShortcuts; | ||
FilterShortcuts.init(); | FilterShortcuts.init(); | ||
| Line 20: | Line 20: | ||
<pre>import caurina.transitions.Tweener; | <pre>import caurina.transitions.Tweener; | ||
| − | |||
| − | |||
invest_mc.onRollOver = function () { | invest_mc.onRollOver = function () { | ||
| Line 28: | Line 26: | ||
Tweener.addTween(protect_mc, {_x:58.5, time:0.3, transition:"easeInOutExpo"}); | Tweener.addTween(protect_mc, {_x:58.5, time:0.3, transition:"easeInOutExpo"}); | ||
}; | }; | ||
| − | |||
invest_mc.onRollOut = function () { | invest_mc.onRollOut = function () { | ||
| Line 35: | Line 32: | ||
Tweener.addTween(protect_mc, {_x:266.5, time:0.3, transition:"easeInOutExpo"}); | Tweener.addTween(protect_mc, {_x:266.5, time:0.3, transition:"easeInOutExpo"}); | ||
} | } | ||
| − | |||
| − | |||
</pre> | </pre> | ||
| − | |||
== Referencing the parent / main timeline == | == Referencing the parent / main timeline == | ||
<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> | ||
| − | |||
== onOverwrite == | == onOverwrite == | ||
| Line 58: | Line 51: | ||
Tweener.addTween(myMovieClip, {_x:100, time:1, onOverwrite:onOvr}); | Tweener.addTween(myMovieClip, {_x:100, time:1, onOverwrite:onOvr}); | ||
} | } | ||
| + | |||
| + | init(); | ||
| + | |||
</pre> | </pre> | ||
| Line 65: | Line 61: | ||
http://hosted.zeh.com.br/tweener/docs/en-us/parameters/base.html | http://hosted.zeh.com.br/tweener/docs/en-us/parameters/base.html | ||
| − | |||
[[Category:Programming]] | [[Category:Programming]] | ||
Latest revision as of 08:44, 12 April 2010
Tweener is an actionscript class library which lets you make all sorts of amazing easing in and out animation effects.
Contents
Blur
import caurina.transitions.Tweener;
import caurina.transitions.properties.FilterShortcuts;
FilterShortcuts.init();
Tweener.addTween(contact_btn,{_Blur_blurX:5,_Blur_blurY:5, _Blur_quality: 2, time:1, transition:"easeInOutExpo"});
_Blur_quality: 2 - is to attain a high quality, which gives an almost gaussian blur effect! otherwise you just have some wanky looking motion blur in each seperate x & y direction.
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"});
onOverwrite
VERY USEFUL!
// Applies two tweenings on a movieclip, warning when the first is overwritten (AS2)
onOvr = function() {
trace ("A tweening has been overwritten at " + this);
delete init;
};
function init(){
Tweener.addTween(myMovieClip, {_x:100, time:1, onOverwrite:onOvr});
}
init();
base
groups of tweens can have the same base:
http://hosted.zeh.com.br/tweener/docs/en-us/parameters/base.html