package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; [SWF(width="400", height="300", backgroundColor="#000000", frameRate="30")] public class AstroTest extends Sprite { private var _direction:int = -1; private var _text:TextField; public function AstroTest() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; var tf:TextFormat = new TextFormat (); tf.size = 32; _text = new TextField (); _text.defaultTextFormat = tf; _text.text = "w00t! This font isn't embedded!"; _text.autoSize = TextFieldAutoSize.CENTER; _text.textColor = 0xFFFFFF; _text.x = (stage.stageWidth / 2) - (_text.width / 2); _text.y = (stage.stageHeight / 2) - (_text.height / 2); addChild(_text); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame (e:Event):void { // fade it if (_text.alpha <= 0) { _direction *= -1; } if (_text.alpha >= 1) { _direction *= -1; } _text.alpha += (.01 * _direction); // Rotate it _text.rotationX += 1; _text.rotationY += 1; _text.rotationZ += 1; } } }