Skip to main content
Participant
April 18, 2012
Question

Accessing downloaded content in../Library/Caches with LoaderMax

  • April 18, 2012
  • 3 replies
  • 1541 views

Hi,

I am trying to port an air for android app to iOS and my main problem has to do with downloaded content.

I have a number of assets ( images and mp3's) that i download and place in the ../Library/Caches folder accordingto the apple guidelines.

My Code relies heavily on Greensock LoaderMax to load the assets into the application.

This works very well on android but i cant get LoaderMax fo find the files on iOS.

i get the following error when debugging on OSX:

i add a number of files with:

                              var queue:LoaderMax = new LoaderMax({name:"soundQueue", onComplete:loopSoundsCompleteHandler, onError:errorHandler});

                                                  fileName =  "Library/Caches/" + fileName;

                                        queue.append( new MP3Loader(fileName, {name:"name1", repeat:-1, autoPlay:false}) );

...

...

and then i load the  queue with

queue.load();

and i reveice the following error:

Error on MP3Loader 'bpallah' (Library/Caches/resources/snd/bpall.mp3): Error #2032: Stream Error. URL: app:/Library/Caches/resources/snd/bpall.mp3

Does anyone have a clue how to do this?

regards,

/Lars

This topic has been closed for replies.

3 replies

January 17, 2013

With AIR 3.6 latest prerelease, A new static property, File.cacheDirectory has been added, which points to the <APPLICATION_HOME>/Library/Caches directory on iOS devices, and files in this directory are not backed up. So, the above workaround is not required.
Another property, preventBackup is introduced in the File API, which when set prevents a file or a folder from getting backed up on the iCloud. This property works on iOS 5.1 devices and later.
You can find additional details on this feature here<http://labsdownload.adobe.com/pub/labs/flashruntimes/shared/air3-6_flashplayer11-6_releasenotes.pdf>

March 1, 2013

neh@adobe, your response makes sense.  Only, I personally want to use LoaderMax because I am loading a number of images that needed to be decoded into Bitmaps.  LoaderMax is good at taking care of this.  Is there another reason that LoaderMax can't load from <APPLICATION_HOME>/Library/Caches ?

Participating Frequently
March 27, 2013

I was able to load assets using LoaderMax by adding "file://" in front of <APPLICATION_HOME>/Library/Caches. Do some tracing of the actual urls you are using. If they don't have the "file://", you will get a stream error.  If "file://" does not work, use "file:///".