Skip to main content
Inspiring
Jul 13, 2016 11:57 AM UTC
Question

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

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Claudio González
Legend
Jul 13, 2016 12:04 PM UTC

If you tell us what Adobe software you are using, we may have your question redirected to the proper forum. This one is for forum related issues, not for help with specific programs.

Translate
rahimhajiAuthor
Inspiring
Jul 13, 2016 1:52 PM UTC

HI claudio,

Thks for ur reply and help. Iam in using Adobe Air for IOS.

thanks and Regards,

Syed Abdul Rahim

Translate