So I've designed a circular preloader that get filled according the percentage of loaded frames. Everything works great with a frame or two of content aside preloader. When I add the all site with a billion of frames and movie clips, the preloader won't work properly and I'm getting really bored with this because I spent like 4 days trying to understand what is wrong.

Unfortunately, I couldn't find the problem I hope that the pro's can give me an explanation of what is going wrong. Thank you all.

Code from preloader:

import flash.display.*;
import flash.events.ProgressEvent;
import flash.events.Event;

stop();

this.loaderInfo.addEventListener(ProgressEvent.PRO GRESS, loading);
this.loaderInfo.addEventListener(Event.COMPLETE, loaded);

function loading(e:ProgressEvent):void{
var porcent:Number = Math.floor((e.bytesLoaded / e.bytesTotal) * 100);
porcent_txt.text = String(porcent) + "%";
loader.gotoAndPlay(porcent);
}

function loaded(e:Event):void{
this.loaderInfo.removeEventListener(ProgressEvent. PROGRESS, loading);
this.loaderInfo.removeEventListener(Event.COMPLETE , loaded);
gotoAndStop("enter");
}