Skip to content

Instantly share code, notes, and snippets.

@netoleal
Created August 30, 2011 10:44
Show Gist options
  • Save netoleal/1180638 to your computer and use it in GitHub Desktop.
Save netoleal/1180638 to your computer and use it in GitHub Desktop.
SimpleTweenSpecialProperties
/*
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
{
}
}
}
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