class Loading { function Loading( text:String ) { if( _root.loading != undefined ) { _root.removeMovieClip("loading"); } var mc:MovieClip = _root.createEmptyMovieClip( "loading", _root.getNextHighestDepth() ); mc.createTextField("txt", mc.getNextHighestDepth(), 5, 5, 100, 100 ); mc.txt.text = text; var fmt:TextFormat = new TextFormat(); fmt.color = 0x000000; fmt.font = "Verdana"; fmt.size = 12; fmt.align = "center"; mc.txt.setTextFormat(fmt); mc.txt.autoSize="left"; mc.txt.setTextFormat(fmt); // // 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. // mc.onEnterFrame = function() { this._x = (Stage.width/2)-((this.txt._width+10)/2); this._y = (Stage.height/2)-((this.txt._height+10)/2); delete this.onEnterFrame; } var cstroke = {width:2, color:0x808080, alpha:100}; var ccolor = {color:0xf0f0f0, alpha:100}; ChartUtil.rrectangle( mc, mc.txt._width+10, mc.txt._height+10, 6, 0,//(Stage.width/2)-((mc.txt._width+10)/2), 0,//(Stage.height/2)-((mc.txt._height+10)/2), cstroke, ccolor); var spin:MovieClip = mc.createEmptyMovieClip( "spinner", mc.getNextHighestDepth() ); spin._x = mc.txt._width+40; spin._y = (mc.txt._height+10)/2; var radius:Number = 15; var dots:Number = 6; var colours:Array = [0xF0F0F0,0xD0D0D0,0xB0B0B0,0x909090,0x707070,0x505050,0x303030]; for( var i=0; i