Skip to main content
Participant
June 12, 2013
Question

Simple way to unload/reload swf in iOS.

  • June 12, 2013
  • 2 replies
  • 1719 views

I'm trying to find a way to completely reload/restart my app at the end or use a seperate collection of swf files when creating an AIR iOS app in Flash Professional. I used a UIloader in flash with a simple preloader before the simple app that I've made but I get the warning "ActionScript contained in externally loaded SWF files will be ignored on iOS devices."

My app works perfectly the first time through, but seems to encounter problems when played a second time, even if all the eventlisteners are removed. I'd like to completely refresh the app when it's played through a second time, either by unloading the main swf and switching to a preloader like I have previosly tried, or by seperating each scene into an easily loadable swf.

Is there an AIR compatible alternative to the UIloader component, or something similar that would allow me to use external swf files with actionscript?

Thanks for any help.

This topic has been closed for replies.

2 replies

Colin Holgate
Inspiring
July 14, 2013

If you're not already doing so, you should give AIR 3.8 a try. Some of the loader issues and warning messages have been taken care of. Also, you'll get warnings about your app not being PIE complient, which doesn't mean it will be rejected. But, using AIR 3.8 will solve that issue too.

For the general approach of having modules that load and unload, we use SWCs. Each module can be tested as a SWF, but we have the publish settings set to make a SWC and a SWF. A quick command-return (or control-enter) test movie will be all it takes to update the SWC. Then we can test the main app FLA, and it will use the updated SWC.

Working that way gives us the same flexibility as we would get with loading external SWFs, and we don't have to worry about using loaders.

Participating Frequently
July 14, 2013

Hi,

thanks for the reply.

I have a Class called "ScreenManager.as" that handles loading and inside the "onComplete function" for the loader, I set the eventlisteners etc for each swf I load.

If I use SWC's instead, where would I handle each file? How do you load/unload? How do you add listeners?

Thanks man

Participating Frequently
July 14, 2013

And by the way, started earlier today using AIR 3.8

Participating Frequently
July 14, 2013


Hi,

I'm having issues with this issue also.

It seems Adobe didn't document so well all the limitations for exporting an application to iOS.

When they sold me the Flash CS6 I was told something like "seamless ios and android building platform".

Did you manage to solve your issues?