i have this simple script in my document class named script.as
public function script(){
stop();
xmlFile = stage.loaderInfo.parameters["path"];
addEventListener(Event.ENTER_FRAME, timer);
txtDebug.text = "start...";
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
}
private function loadProgress(evt:Event):void{
txtDebug.text += "loading..."
txtDebug.text += Math.round(evt.target.bytesLoaded / evt.target.bytesTotal * 100) + "%";
}
private function loadComplete(evt:Event):void{
txtDebug.text += "...complete";
}
we can see that i made a textbox display the internal processes i wanted to see.
so i’m expecting a sequence of “start…” - “loading…” - <percentage>% - “…complete”
my problem is, at first load, the entire thing works, but after i navigate to other pages, or reload, i’m stuck with the message “start…” this made my assumption that ProgressEvent.PROGRESS is not triggered
what could be my mistake?
Thank you!