複数が動く
forked from forked from: flash on 2012-3-10 (diff: 15)
ActionScript3 source code
/**
* Copyright umhr ( http://wonderfl.net/user/umhr )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/wVs8
*/
// forked from umhr's forked from: flash on 2012-3-10
// forked from umhr's flash on 2012-3-10
package {
import flash.events.MouseEvent;
import flash.display.Sprite;
import org.libspark.betweenas3.BetweenAS3;
import org.libspark.betweenas3.easing.*;
public class FlashTest extends Sprite {
private var circle:Sprite = new Sprite();
private var circle2:Sprite = new Sprite();
private var circle3:Sprite = new Sprite();
public function FlashTest() {
// write as3 code here..
circle.graphics.beginFill(0xFF0000);
circle.graphics.drawCircle(0,100,40);
circle2.graphics.beginFill(0x00FF00);
circle2.graphics.drawCircle(0,100,40);
circle3.graphics.beginFill(0x0000FF);
circle3.graphics.drawCircle(0,100,40);
this.addChild(circle);
this.addChild(circle2);
this.addChild(circle3);
BetweenAS3.to( circle, { x:300 },2,Back.easeOut ).play();
stage.addEventListener(MouseEvent.CLICK,onClick);
}
private function onClick(event:MouseEvent):void{
BetweenAS3.to(circle,{x:400*Math.random(),y:400*Math.random()},3,Elastic.easeOut).play();
BetweenAS3.to(circle2,{x:400*Math.random(),y:400*Math.random()},3,Elastic.easeOut).play();
BetweenAS3.to(circle3,{x:400*Math.random(),y:400*Math.random()},3,Elastic.easeOut).play();
}
}
}
