var request:URLRequest=new URLRequest("chatRoom.swf");
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(request);
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number=event.bytesLoaded/event.bytesTotal;
percentLoaded=Math.round(percentLoaded*100);
my_text.text="已加载"+percentLoaded+"% 请稍候.......";
//trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
trace("Complete");
addChild(loader);
}