Skip to main content
Participating Frequently
May 24, 2013
Question

Problem when loading swf asset packaged in the device.

  • May 24, 2013
  • 2 replies
  • 577 views

Hi, I'm having an problem, I got the following line of code that should take care of the loading of assets that I package when I create the ipa file:

file = File.applicationDirectory.resolvePath("assets/" + path);

                                                  if(file.exists)

      return file.url ;

This works OK in web and in Android, however, in my iPad it just doesn't work, the exists returns false, always.

I check the assets folder when I package the ipa, so it should be there, but I don't know how to retrieve the file.

I'm using Air 3.7.

Any ideas?.

Thanks.

This topic has been closed for replies.

2 replies

Known Participant
July 8, 2013

Maybe try:

file = File.applicationDirectory.resolvePath("assets"+ File.separator + path);

                                                  if(file.exists)

Inspiring
May 26, 2013

This works fine for me in iOS:

var f:File = File.applicationStorageDirectory.resolvePath(file);

Inspiring
May 26, 2013

SOrry - I forgot to add that I don't think you need the 'assets' sub-directory - although I may be wrong