Show progress through AC3
Hi
I've been having a hard time for some days now trying to make a progressbar in AC3. I searched the web and tried several different approaches and attempts but nothing works.
I hope I can get some input from here now...
The main portion of the applicataion is working. It's only when I try to use AC3 to control the jumps in the timeline the problem occours.
This is my AC3-code:
import flash.events.*;
import flash.display.Loader;
stop();
addEventListener(Event.ENTER_FRAME, myFunction);
var p_loader:URLLoader=new URLLoader();
//addChild(p_loader);
function myFunction(evt:Event){
kirupatxt.text = "TESTING";
removeEventListener(Event.ENTER_FRAME,myFunction);
var bytes = p_loader.bytesTotal;//evt.bytesTotal();
trace("bytes_total: "+ bytes);
trace("inside 'myFunction' in Preloader 1");
var bytes_loaded = p_loader.bytesLoaded;
trace("bytes_loaded: "+ bytes_loaded);
if (bytes_loaded == bytes){
kirupatxt.text = "movie loaded";
gotoAndPlay("scene1");
trace("inside 'myFunction' in Preloader 5");
}else{
this.kirupatxt.text = "loading (" + bytes_loaded + "/" + bytes +")";
gotoAndStop("preloader");
}
}
As I run the code all the trace-statements is printed. But the bytes is 0 all the time. I guess this has something to do with the main problem. I tried to simulate the download-process, but in this way not even the "kirupatxt.text = "TESTING";" is printed in my dynamic textfield.
As my cody shows I've been trying to solve the problem in different ways of debugging.
If somebody is able to provide some help here I'd be VERY thankfull!
Thanks in advance.
