Search code examples
iosflashairpathflash-cs6

In Air iOS, what is the path for the included folder which is above .fla file folder?


I have "assets" folder above "src" folder where .fla file is. The assets folder is included via Air iOS publish setting in Adobe Flash CS6 Professional but I'm having trouble accessing it.

the directory structure looks like this. Main.as is the document class for my project.

c:\
  project
    assets
    bin
    lib
    src
      Main.as
      Main.fla

Now if the project was an action script project, I can normally access the assets folder by using a path like "../assets". But in Air for iOS project, it says the folder isn't there.

In the Air iOS publish setting window, it says the included folder path is "c:\project\assets" whereas when I move the assets folder under src folder it just says "assets" and then it can be accessed simply by using a path like "\assets".

Does anyone have an idea where the included folder is placed?


Solution

  • The folder is placed in File.applicationDirectory. If your SWF is being published to the bin folder, you can simplify testing by placing the assets folder inside the bin folder.

    Then, to access a file inside the assets folder:

    var myFile:File = File.applicationDirectory.resolvePath("assets/SomeFile.jpg");
    trace(myFile);