var loader:Loader = new Loader();
var request:URLRequest;
var percent:Number;
prelo("path_to_a_file"); //// function that starts loading passed item
function prelo(path:String):void
{
request = new URLRequest(path);
loader.load(request);
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
}
function showProgress(event:ProgressEvent):void ///////////// display progress animation
{
percent = Math.round((event.bytesLoaded / event.bytesTotal )*100 );
///////// if text file used
//PercentText.text = percent + "%";
}
function onLoaded(event:Event):void /////////// when content is loaded
{
/// content loaded !!!
}