flash on 2009-2-25
Progressionのコマンドを使って、図形を描いてみる
//Progressionのコマンドを使って、図形を描いてみる
package {
import flash.display.Sprite;
import jp.progression.commands.*;
[SWF(width=500, height=400, backgroundColor=0xFFFFFF, framelate=30)]
public class Test extends Sprite {
public var s:Sprite = new Sprite();
public function Test(){
var sList:SerialList = new SerialList();
sList.addCommand(
new AddChild(this, s),
function():void{
s.graphics.lineStyle(3,0xFF0000);
s.graphics.moveTo(100,100);
s.graphics.lineTo(150,200);
},
new Wait(1000),
function():void{
s.graphics.lineTo(50,200);
},
new Wait(1000),
function():void{
s.graphics.lineTo(100,100);
}
);
sList.execute();
}
}
}