Bookmark and Share

Following from previous post, I have finally got some times to polish some features and fix bugs and it has been used in some of my projects already so I have released it as beta for the moment, download the Domo swc here.

The plugin API has changed and Typo effect removed as it is not suited for this package.

Quick instruction:

To add a motion and assume you have “ball” instance on stage:

?View Code ACTIONSCRIPT
1
2
3
4
import com.xllusion.motion.Domo;
import com.xllusion.motion.easing.Quad;
 
Domo.addMotion(ball, {duration:1, x:100, y:100, ease:Quad.easeIn});

I have also added “yoyo” property so the ball can be looped:

?View Code ACTIONSCRIPT
1
Domo.addMotion(ball, {duration:1, x:100, y:100, yoyo:true, ease:Quad.easeIn});

You can delay the motion by adding “delay” property. Domo will overwrite the tweens with the same object by default and the latest tween will take priority but you can add “overwrite=false” property so it won’t overwrite previous tween or set static class property “Domo.overwrite = false” for all tweens, use with caution though:

?View Code ACTIONSCRIPT
1
2
Domo.addMotion(ball, {duration:1, x:100, y:100});
Domo.addMotion(ball, {duration:1, delay:1, overwrite:false, alpha:0.5, y:200});

Here is list of properties you can add:

?View Code ACTIONSCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// duration
// delay
// useFrames
// overwrite
// yoyo
// ease
// onStart
// onStartParams
// onUpdate
// onUpdateParams
// onComplete
// onCompleteParams
 
Domo.addMotion(ball, {duration:1, delay:1, useFrames:true, overwrite:false, x:100, y:100, yoyo:true, ease:Quad.easeIn, onStart:onStartFunction, onStartParams:["hello",1], onUpdate:onUpdateFunction, onUpdateParams:[2], onComplete:onCompleteFunction, onCompleteParams[3]});

Currently there are 3 plugins, I have used “_” prefix to distinguish from object properties: “_filter”, “_brightness” and “_color”.

Domo will automatically add required plugin classes when detect those properties.

Filter tween, assume you have blur filter applied as first one:

?View Code ACTIONSCRIPT
1
2
// "index" property indicates the position of filter applied, 1st one is 0.
Domo.addMotion(ball, {duration:1,  _filter:{blurX:20, blurY:20, index:0}});

To tween 2 different filters on the same object, add “overwrite = false” for the 2nd tween.

Brightness tween:

?View Code ACTIONSCRIPT
1
2
// "_brightness" property takes number between -1 and 1.
Domo.addMotion(ball, {duration:1,  _brightness:1});

Color tween:

?View Code ACTIONSCRIPT
1
2
// "_color" property takes color value.
Domo.addMotion(ball, {duration:1,  _color:0xff0000});

if you have both “_brightness” and “_color” properties, “_color” will take priority. I will improve the engine and add more plugins in the future, please let me know if you have found any bugs, thanks:)