How to Stop Loading in As3 & As2
In Stage having two buttons btn, btn1 movieClips. when i click btn load a test.swf file . if the swf file size is too heavy i want to stop the loading, with usind btn1 click. How i can stop the loading . Please provide the solution in AS2 & AS3
var ldr:Loader;
btn.addEventListener(MouseEvent.CLICK,statrLoading);
btn2.addEventListener(MouseEvent.CLICK,stopLoading);
function statrLoading(e:MouseEvent) {
loadStrt();
}
function stopLoading(e:MouseEvent) {
ldr.close();
// it is not Working
}
function loadStrt() {
ldr = new Loader();
var url:String = "test.swf";
var urlReq:URLRequest = new URLRequest(url);
ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,Onprogress);
ldr.load(urlReq);
addChildAt(ldr,1);
}
function Onprogress(e:ProgressEvent) {
txt.text=e.bytesLoaded+" of "+e.bytesTotal;
}
