Actionscript ldbar
9 years ago
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OOooo journals so fahn to read (plz don't be offended this is how I react to journals)
SOOOOOOOOOOOOOO wanting to learn how to do that loader bar.. okay so here's the thing or problem i see on a day to day basis on loader bars and why people do or not do them... and I'm just like "Make the god damn loader bar so people can watch leh flash without having any laaaaaaag" lol but yeah so I'm here to teach you how to actually make a loader bar.....without pictures tho so just the code basically...
import flash.events.Event;
stop();
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;
/*Bar name here*/ = loaded/total
/*dynamic text frame name here*/.text = Math.floor((loaded/total)*100)+ "%";
if (loaded == total){
play();
this.removeEventListener(Event.ENTER_FRAME, loading);
}
}
so yeah there ya go so basically "Bar name here" is whatever the instance name you gave the loader bar and "dynamic text frame name here" is whatever you gave the dynamic hopefully blank text box the instance name of so yeah if this helps let me know..