2 Replies Latest reply on Aug 22, 2011 4:14 AM by Starlover_jacob

    air assets are gone on mac installation

    Starlover_jacob Level 1

      Hi,

       

      I have a project with a folder of images that are not embedded into my project. (to keep a quick start)

      I use a function to collect all images from that folder like this:

       

      public function getallfilesinfolder(foldername:String):Array
      {
           var filearray:Array=new Array();
           var directory:File = File.applicationDirectory;
           directory = directory.resolvePath("gardenimages/"+foldername+"");
           var contents:Array = directory.getDirectoryListing(); 
           for (var i:Number = 0; i < contents.length; i++)
           { 
                  if(contents[i].type==".jpg" ||contents[i].type==".JPG" || contents[i].type==".png")
                  filearray.push(contents[i].url);
                //filearray.push(contents[i].nativePath);
           }               
           return filearray;
      }
      

       

      The problem i have is when i install my air application on a windows machine, the function gives me an array of image urls.

      On a mac, the array is empty.. i also cannot find the files on a mac.

       

      What am i doing wrong here?

       

      Please some help.

      Greets, J.

        • 1. Re: air assets are gone on mac installation
          Starlover_jacob Level 1

          I found this answer on another page:

           

          ----------------------------------------------------------------

          Create an folder inside your Flex  project.

          Right click on your project and go to Properties->Compiler  (not exact name but something like that). Make sure it has "Copy  nonembedded assets to output directory" (check it if it doesn't). Click  Ok.

          Export a release build of your AIR app. Do NOT click Finish after the  "signing" step. Follow each step until you get to the "assets" screen.  It will show you a list of every file and folder in your output  (bin-debug, by default) directory.

          Check the files you want, uncheck the one's you don't, and click OK.  Done. You have your AIR file packaged with whatever file and folder you  want.

          ------------------------------------------------------------------

           

          I did that. Still not working for me.

          I also found:

           

          ---------------------------------------------------------------

          NOTE: On OSX, anything included in the AIR package will be part of the "Package Contents" so the folder is inside the .app file.

          On Windows it is alongside the exe.

          --------------------------------------------------------------

           

           

           

          But now the question; how do i access this folder and files on a mac so it works on a mac and a windows machine?