Skip to main content
emmau10371638
Inspiring
August 10, 2016
Answered

Home_btn to reload iOS app is not working???

  • August 10, 2016
  • 1 reply
  • 3076 views

hello again,

I can't find the solution.

I hope someone can help me because I'm desparate.

I  have a main-SFW within several levels-SWF's.

Now I want on each level a Home_btn so I can reload the app.

Here is my code in some SWF-level:

Home_btn.addEventListener(MouseEvent.CLICK, go_home);

function go_home(event: MouseEvent) {

  var appDomain_1:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);

var context1:LoaderContext = new LoaderContext(false, appDomain_1);

var loader1:Loader = new Loader();

var file1: File = File.applicationDirectory.resolvePath("main.swf");

loader1.load(new URLRequest (file1.url), context1);

  addChild(loader1);

}

in the main.SWF the level_SWF's won"t open again.

I have included all SWF's in the MainSWF and the main SWF also.

I hope someone can help me.

This topic has been closed for replies.
Correct answer kglad

hello,

the movieclip go_1 doesn't work on the ipad.

when you touch  the movie clip nothing happens

.(the mouse(down)_function )on the computer it works very good.

a mouse function separately (not in a for loop )is not a problem on the ipad.

tnx for reply.


attach a screenshot of your air for ios settings panel that shows your included files.

1 reply

kglad
Community Expert
August 10, 2016

each level swf can direct the main swf to unload the level swf, but because your main swf is not loaded, i don't think you want to load it into itself.

emmau10371638
Inspiring
August 10, 2016

hello,

tnx for reply..

the structure of my app is:  before I open a new level the previous level has been unloaded.

But now I want back to start the whole app again with new levels SWF's.

First I think I must close the app.But I don't know how to do this. Because the NativeApplication.

NativeApplication.exit (); didn't work. Sorry i didn't understand it at all. I hope you can help me.

kglad
Community Expert
August 20, 2016

oh oh i'm here again on the forum.

This code (above) and the code above this code gives the same problem.

The dispatcherEvent doesn't work.

The debug gives no report. not on the ipad. not on the computer.


use the trace function to make sure that the loader is dispatching the expected event.