How to find installed assets on mac in applicationdirectory

Hi,
File.applicationDirectory—the read-only directory where the application is installed (along with any installed assets)
How do i get to this assets folders/files on a mac?
I tried the following, but i don't get a list of files.... it works on a windows machine..
structure:
myapp.air
assets/folder1/img1.jpg
assets/follder1/img2.jpg
assets/folder2/anotherimage.jpg
urlarray:Array=getallfilesinfolder(folder1);
public function getallfilesinfolder(foldername:String):Array
     var filearray:Array=new Array();
     var directory:File = File.applicationDirectory;
     directory = directory.resolvePath("assets/"+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);
     return filearray;
Please some help.
Perhaps you also know a solution for folders that begin wit a # (%23).
When i want to get a filelist from that folder, the function simply stops on a mac. no error... nothing

Hi, i found my answer.
It turns out that mac doesn't use type. Instead i had to check on extension
contents[i].extension=="jpg"
How i found out? to alert some variables like this.
first i checked if the folder assets/folder1 exists
import mx.utils.ObjectUtil;
var directory:File = File.applicationDirectory;
directory = directory.resolvePath("gardenimages/"+foldername+"");
Alert.show("test:"+ObjectUtil.toString(directory));
It will get you a long list of info on the folder. by checking the nativepath, url and exists we can tell if the folder is there.
Now check the contents of that folder to see if the images are there.
var contents:Array = directory.getDirectoryListing();
var sTemp:String = "";
for (var i2:int=0;i2<contents.length;i2++)
       sTemp += contents [i2].name + "\n";
       sTemp += contents [i2].exists + "\n";
       sTemp += contents [i2].nativePath + "\n";
       sTemp += contents [i2].url + "\n";
       sTemp += contents [i2].type + "\n";
       sTemp += contents [i2].extension + "\n";
       sTemp += "----------- \n";
and you will see.. on a mac type is null
Greets, J.

Similar Messages

  • I would like to update the latest Adobe Flash as mine is outdated, but it says it can't install as my antivirus software is preventing it and I need to allow it.  My problem is I don't know what my antivirus software is or how to find it on my Mac to

    I would like to update the latest Adobe Flash as mine is outdated, but it says it can't install as my antivirus software is preventing it and I need to allow it.  My problem is I don't know what my antivirus software is or how to find it on my Mac OS X 10.9.5 to adjust the settings.  Help

    We don't know what it is either.

  • I accidentally erased mac os 10.6 while installing windows 7 on macbook air, how do I install back to mac?, I accidentally erased mac os 10.6 while installing windows 7 on macbook air, how do I install back to mac?

    I accidentally erased mac os 10.6 while installing windows 7 on macbook air, how do I install back to mac?, I accidentally erased mac os 10.6 while installing windows 7 on macbook air, how do I install back to mac?

    Use the Flash Drive that came with your computer it has Snow Leopard installed on it. If you lost it or cannot find it then call Apple and they will replace it for you, I don't know how much they will charge.
    BTW when installing MS Windows please follow the directions whether you are using Boot Camp or a vitualialization solution (Parallels, Fusion, etc.) had  you done this you would not have had any issues.

  • How to find out if your Mac has the new Virus ?

    How to find out if your Mac has the new Virus, and how to fix it ???

    Helpful Links Regarding Flashback Trojan
    A link to a great User Tip about the trojan: Flashback Trojan User Tip
    A related link in the tip to a checker: Malware Checker Dowload Link
    A Google search can reveal a variety of alternatives on how the remove the trojan should your computer get infected. This can get you started.
    For now I recommend the User Tip from etressoft to detect and remove:
    Checking for and removing the "Flashback" trojan
    Kaspersky Flashback Trojan Site:Flashback Trojan Detection and Removal
    Also see Apple's article About Flashback malware.

  • How do i install office for mac 2008 to my new i mac which has no optical drive. I have the Office discs and product key

    how do i install office for mac 2008 to my new i mac which has no optical drive. I have the Office discs and product key

    You could purchase any commonly available external USB DVD/CD writer, such as the excellent LG brand units sold on Amazon, for about $30 US.  I've used an LG writer for years to save wear and tear on my older Superdrive.

  • How to find out asset number in SAP

    Hi,
    Please let me know how to find out asset number based on the depreciation document number.
    Regards,
    Bhaskar Suruvu

    In the FI document header text / line item text you found back the asset document number like:
    AFB01200900101-0000000001
    In the table ANLP you can found back the document number -0000000001
    On this way you can make the link

  • How to find installed versions in R12 on Windows

    how to find installed versions in R1213 on Windows 2008 server

    Hi;
    how to find installed versions in R1213 on Windows 2008 serverWhat you mean? You can install R12.1 than rise R12.1.3
    Follow below notes:
    How to check if certain Oracle Applications product/module is implemented? [ID 443699.1]
    How to check, which EBS Techstack Patchsets have been applied on 11i or R12 ? [ID 390864.1]
    Regard
    Helios

  • How do I install Ubuntu on Mac?

    I was wondering about Ubuntu and learning more about it.
    I used Boot Camp once to install Windows 7 Ultimate, but I wasn't satisfied with Windows 7, so I removed it. I thought Windows 7 was really boring and I missed many of the games included with XP that were excluded.
    So how do you install Ubuntu on a Mac?
    I've heard of using virtual software to install Ubuntu, but is it possible to install Ubuntu via Boot Camp?
    Here's my system info:
    15.4-inch MacBook Pro 2.8 GHz (Mid-2009)
    Mac OS X v10.6.7 Snow Leopard
    Let me know what I need to get started

    Hi,
    the Ubuntu community has a very good place to start here https://help.ubuntu.com/community/MacBook
    Nonetheless I would propose to start with the free VirtualBox as install/use Ubuntu in a Virtual Machine.
    If you don't like it it is easier to remove...
    Regards
    Stefan

  • How to find installed SMD Agent version?

    Hi,
    Please let me know how to find the installed SMD agent version in managed system.
    Thanks,
    Kavitha Rajan.

    Hello,
    Something really easy to differentiate the agents installed:
    -     7.01-> /usr/sap/SMD/JXX
    -     7.11 or 7.20 -> /usr/sap/DAA/SMDAXX
    Regards,
    Allam

  • Help me how can i install windows in mac mini

    we know that mac doent have disk support and i want to install window in mac so how can i by pen drive or etc gelp me

    bbold wrote:
    I'm curious about this, too. You may have to purchase an Apple USB Superdrive. I'm getting one of those soon anyways.
    You don't have to use an Apple drive.  Any name brand
    USB CD/DVD drive will work.  "Off brands" are best to
    be avoided regardless of computer.  LG's seem to work
    quite well for me.

  • How  can    ı  find  video   downloader  for   mac

    ı  want   to  download   videos   from  utube   ,  ı  need  video   downloader   for  mac  book  air   ,  how   can  ı  find  SAFELY,  for  mac  book  air

    youtube currently changes its algorithm nearly every week now so as to stop the youtube download plugins from working on popular videos
    it is against google/youtubes terms of service to download their videos.    As such I cannot recommend you downloading them whatsoever

  • HOW DO YOU INSTALL CS6 FOR MACS

    CAN'T INSTALL CS6 FOR MAC'S.  TRIED EVERYTHING FOR HOURS AND CAN'T TALK TO A HUMAN BEING AT ADOBE.

    Duplicate post
    HOW DO YOU INSTALL CS6 FOR MACS

  • How do I install PSE8 on MAC with case sensitive drive?

    I tried to install PSE8 for mac and i get an error saying it cannot be installed on a case sensitive drive.
    Is there a fix for this?

    What is the purpose of this?
    I have my drive formatted case sensitive on purpose for more security and stability.
    Why on earth would y'all choose to do this?

  • How do I install applications on Mac OS X?

    Hi all:
    I am a complete newbie to the Mac World, am from the pc world.
    I am trying to install applications. I have downloaded a few from the web and I have no idea how to install them. Double clicking on them doesn't do the job.
    Please help
    Thanks!
    Powerbook G4 12"   Mac OS X (10.4)  

    Applications either include their own installer or are provided and downloaded via a disk image.
    If an application includes an installer, you will be prompted for your admin password after double-clicking on the downloaded and then provided prompts such as where you want to install the application, etc.
    If an application is provided via a disk image, when double-clicking on the download (the download will include a .img extension such as xxxxxx.img), the disk image is mounted on the Desktop and the application is within.
    Open another Finder window and drag the application from within the mounted disk image to your Applications folder which copies the application to your hard drive.
    To unmount the disk image, drag the disk image to the Trash can in the Dock or select the disk image and at the Finder menu bar, go to File and select Eject. You can then delete the downloaded xxxxxx.img file.

  • How do I install Java for Mac OS X Lion?

    After installed Lion, I always reive a message " TO open"JAVA," you need to install a JAVA Runtime, but you not connected to the internet." but I was connect to the internet. I following the instuction to test the net connection, the net is fine, I change from WIFI to Lan, still same.
    I did installed Lion to my Air, after installed, the download for Runtime is auto. The problem happend with my MBP i7.
    Please help me, without this, I can not regist my Quickbooks on like.

    thanks, it won't work. But I find out Java is not part of Mac OSX anymore, you have to install it manually. You can get it here: http://support.apple.com/kb/DL1421
    I have just install it, it WORKS!!!!!!

Maybe you are looking for