Created
August 30, 2011 10:44
-
-
Save netoleal/1180638 to your computer and use it in GitHub Desktop.
SimpleTweenSpecialProperties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Exemplo de criação de propriedade personalizada. | |
Exemplo de uso: | |
SimpleTween.registerSpecialProperty( "scale", new ScaleProperty( ) ); | |
SimpleTween.create( ).make( foolMC, { scale: 1.5 }, 666, easeOutCirc ); | |
*/ | |
package asf.fx | |
{ | |
import asf.interfaces.ISpecialProperty; | |
public class ScaleProperty implements ISpecialProperty | |
{ | |
public function ScaleProperty() | |
{ | |
} | |
public function getValue(target:*):Number | |
{ | |
return target.scaleX; | |
} | |
public function setValue(target:*, value:Number, start:Number = 0, end:Number = 0 ):void | |
{ | |
ScaleProperty.setValue( target, value, start, end ); | |
} | |
public static function setValue(target:*, value:Number, start:Number = 0, end:Number = 0):void | |
{ | |
target.scaleX = value; | |
target.scaleY = value; | |
} | |
public function dispose():void | |
{ | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asf.fx.SimpleTween; | |
import asf.fx.SimpleTweenProperties; | |
import com.robertpenner.easing.circ.easeOutCirc; | |
import com.robertpenner.easing.cubic.easeInOutCubic; | |
import com.robertpenner.easing.expo.easeInOutExpo; | |
SimpleTweenProperties.init( ); | |
var time1:uint = 250; | |
var time2:uint = 600; | |
SimpleTween.create( ).make( target, { rotationX: 20, brightness: -80, blur: 5 }, time1, easeOutCirc ) | |
.queue( SimpleTween.create( ).make, target, { rotationX: -20, brightness: 60 }, time2, easeInOutExpo ) | |
.queue( SimpleTween.create( ).make, target, { rotationX: 0, brightness: 0, blur: 0 }, time2 * 0.7, easeInOutCubic ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment