Search code examples
actionscript-3flashaircd

make my adobe air app work only with CD after installation


I want to make my adobe air application that uses some data like (xml, png, ...) works only if the CD ROM exist ! means after installation the user must put the CD and run the app from the icon on desktop ! is it possible with flash/as3 ? thank you


Solution

  • you can do a little trick, at the launch of the app you can search for a file on that cdrom and show an alert if you don't find it. Here a simple way of getting all drives of the user computer:

    var list:Array = File.getRootDirectories();
    

    the list array contain File objects relative of all drives in the computer, afeter that you can search for a file inside the root of the drive or somewhere else.