Reloading swf inside a loader in Air for IOS
Hi friends,
Iam creating an elearning app. i have 4 buttons on stage, when user clicks it will load 4 different lessons. I have created the following codes, its working fine. when i click same button again it is not loading the lesson. only one time i can click and load a lesson, 2nd time it is not loading.
Kindly help me to solve the issues..
import flash.events.MouseEvent;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.system.LoaderContext;
import flash.system.ApplicationDomain;
var no_les:Number = 4;
var ldr: Loader = new Loader();
var req: URLRequest = new URLRequest();
var lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
for (var inc1: Number = 1; inc1 <= no_les; inc1++) {
this["bt" + inc1].addEventListener(MouseEvent.CLICK, menu_clicked);
}
function menu_clicked(event: MouseEvent) {
ldr = new Loader();
req.url = "app:/assets/lessons/les"+event.target.name.substr(2)+"/lmsframe.swf"
ldr.load(req,lc);
load_box.addChild(ldr);
}
close_but.addEventListener(MouseEvent.CLICK, close_clicked);
function close_clicked(event:MouseEvent){
MovieClip(ldr.content).currentMovie.content_mc.gotoAndStop(1);
for(var inc2:Number = 0; inc2<=load_box.numChildren-1; inc2++){
load_box.removeChildAt(inc2);
}
ldr.unload();
}
Thanks in advance,
Regards,
Syed Abdul Rahim
