Flash CS3 - Flash website with a simple preloader
download preloader.zip
//////////////////////////////////
stop();
var Circle = new Shape();
Circle.graphics.lineStyle(5,0x00FF00);
Circle.graphics.drawCircle(100, 100, 50);
var Line = new Shape();
Line.graphics.lineStyle(5,0x00FF00);
Line.graphics.lineTo(0,-40);
Line.x=100;
Line.y=100;
var Status = new TextField();
Status.autoSize =TextFieldAutoSize.CENTER;
Status.selectable = false;
Status.y = 100;
Status.x = 100;
addChild(Circle);
addChild(Line);
addChild(Status);
function PreLoader() {
this.loaderInfo.addEventListener(Event.COMPLETE, initApplication);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
}
function showProgress(theProgress:ProgressEvent):void {
var percent:Number =(theProgress.bytesLoaded) / (theProgress.bytesTotal)*100;
Line.rotation=percent*3.6;
Status.text = Math.round(percent)+" %";
}
function initApplication(myEvent:Event):void {
removeChild(Circle);
removeChild(Line);
removeChild(Status);
gotoAndStop("frm_main");
}
PreLoader();
//////////////////////////////////
Comments