/** * ... * @author Default * @version 0.1 */ package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; import flash.events.Event; import flash.filters.DropShadowFilter; public class Loading extends Sprite { private var tf:TextField; public function Loading( text:String ) { this.tf = new TextField(); this.tf.text = text; var fmt:TextFormat = new TextFormat(); fmt.color = 0x000000; fmt.font = "Verdana"; fmt.size = 12; fmt.align = "center"; this.tf.setTextFormat(fmt); this.tf.autoSize = "left"; this.tf.x = 5; this.tf.y = 5; // // HACK! For some reason the Stage.height is not // correct the very first time this object is created // so we wait untill the first frame before placing // the movie clip at the center of the Stage. // this.addEventListener( Event.ENTER_FRAME, this.onEnter ); this.addChild( this.tf ); this.graphics.lineStyle( 2, 0x808080, 1 ); this.graphics.beginFill( 0xf0f0f0 ); this.graphics.drawRoundRect(0, 0, this.tf.width + 10, this.tf.height + 10, 5, 5); var spin:Sprite = new Sprite(); spin.x = this.tf.width + 40; spin.y = (this.tf.height + 10) / 2; var radius:Number = 15; var dots:Number = 6; var colours:Array = [0xF0F0F0,0xD0D0D0,0xB0B0B0,0x909090,0x707070,0x505050,0x303030]; for( var i:Number=0; i