forked from: forked from: flash on 2012-3-10
forked from forked from: flash on 2012-3-10 (diff: 91)
ActionScript3 source code
/**
* Copyright Masayuki.Kondo ( http://wonderfl.net/user/Masayuki.Kondo )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/dr6R
*/
// forked from Masayuki.Kondo's forked from: flash on 2012-3-10
// forked from umhr's flash on 2012-3-10
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import org.libspark.betweenas3.BetweenAS3;
import org.libspark.betweenas3.easing.*;
public class FlashTest extends Sprite {
private var kondo:Sprite = new Sprite();
private var kondo1:Sprite = new Sprite();
public function FlashTest() {
// write as3 code here..
graphics.beginFill(0x000000,0.5);
graphics.drawRect(0,30,2000,5);
graphics.beginFill(0x000000,0.5);
graphics.drawRect(100,0,5,2000);
graphics.beginFill(0x000000,0.5);
graphics.drawRect(200,0,5,2000);
graphics.beginFill(0x000000,0.5);
graphics.drawRect(400,0,5,2000);
graphics.beginFill(0x000000,0.5);
graphics.drawRect(300,0,5,2000);
graphics.beginFill(0x000000,0.5);
graphics.drawRect(100,0,5,2000);
graphics.beginFill(0x000000,0.5);
graphics.drawRect(0,200,2000,10);
graphics.beginFill(0x000000,0.5);
graphics.drawRect(0,200,2000,5);
graphics.beginFill(0x000000,0.5);
graphics.drawRect(10,300,2000,10);
graphics.beginFill(0x333333);
graphics.drawRect(45,0,5,2000);
graphics.beginFill(0xff0000);
graphics.drawRoundRect(105,150,50,50,20,20)
kondo.graphics.beginFill(0xFF0000);
kondo.graphics.drawCircle(0,100,5);
kondo1.graphics.beginFill(0xFF0000);
kondo1.graphics.drawCircle(0,100,5);
this.addChild(kondo);
this.addChild(kondo1);
BetweenAS3.to( kondo, { x:200 },2,Bounce.easeOut ).play();
BetweenAS3.to( kondo1, { x:200 },3,Bounce.easeOut ).play();
stage.addEventListener(MouseEvent.CLICK,onClick);
}
private function onClick(event:MouseEvent):void{
BetweenAS3.to(
kondo,{x:400*Math.random(),y:400*Math.random()},1,
Bounce.easeOut
).play();
}
//this.addEventListener(Event.ENTER_FRAME,onEnter);
//private function onEnter(e:Event):void{
// kondo.x += 2;
// kondo.y += 1;
// if(kondo.x > 400){
// kondo.x= 0;
//}
// if(kondo.y > 400){
// kondo.y = 0;
//}
// }
//}
}
}
