Return to Snippet

Revision: 29660
at August 2, 2010 20:29 by Daxander


Updated Code
loader3D.visible = true;

this.addEventListener(Event.ENTER_FRAME, loading);

function loading(e:Event):void{

	var total:Number = this.stage.loaderInfo.bytesTotal;
	var loaded:Number = this.stage.loaderInfo.bytesLoaded;

	loader_txt.text = Math.floor((loaded/total)*100)+ "%";

	if (loaded == total){
		gotoAndPlay(2);
		this.removeEventListener(Event.ENTER_FRAME, loading);
		loader3D.visible = false;
		}
	
}

Revision: 29659
at August 2, 2010 20:28 by Daxander


Initial Code
loader3D.visible = true;

this.addEventListener(Event.ENTER_FRAME, loading);

function loading(e:Event):void{

	var total:Number = this.stage.loaderInfo.bytesTotal;
	var loaded:Number = this.stage.loaderInfo.bytesLoaded;

	loader_txt.text = Math.floor((loaded/total)*100)+ "%";

	if (loaded == total){
		gotoAndPlay(2);
		this.removeEventListener(Event.ENTER_FRAME, loading);
		loader3D.visible = false;
		}
	
}

Initial URL

                                

Initial Description

                                

Initial Title
AS3: Preloader on frame 1

Initial Tags

                                

Initial Language
ActionScript 3