init(s)
private function init():void
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
box = new Sprite();
box.graphics.beginFill(0xff0000);
box.graphics.drawRect(-50, -50, 100, 100);
box.graphics.endFill();
addChild(box);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
frame(s)
private function onEnterFrame(event:Event):void
{
angle += .05;
var cos:Number = Math.cos(angle);
var sin:Number = Math.sin(angle);
box.transform.matrix = new Matrix(cos, sin,
-sin, cos,
stage.stageWidth / 2,
stage.stageHeight / 2);
}
}
}