flash on 2012-4-27
package {
import flash.display.Sprite;
import flash.display.Graphics;
import flash.events.MouseEvent;
public class FlashTest extends Sprite {
public function FlashTest() {
var a:Array = [];
var i:int = 0;
var button:Sprite = new Sprite();
button.graphics.beginFill(0);
button.graphics.drawRect(0,0,100,50);
button.graphics.endFill();
addChild(button);
for(i = 0; i < 100; i++)
{
a[i] = new Sprite();
a[i].graphics.beginFill(i*i*i*i);
a[i].graphics.drawCircle(0,0,i / 10);
a[i].graphics.endFill();
a[i].x = Math.random() * stage.stageWidth;
a[i].y = Math.random() * stage.stageHeight;
addChild(a[i]);
}
i = 100;
function asdf(e:MouseEvent):void
{
removeChild(a[i]);
i--;
} button.addEventListener(MouseEvent.CLICK, asdf);
}
}
}