1 Reply Latest reply on Oct 28, 2010 10:33 AM by Joe ... Ward

    Getting started with Air (iTunes integration/autorun questions)


      Hi, I'm new to Air but fairly well versed in AS3. I'm looking to develop an Air app which would run from a usb flash pen so am just pondering a few questions and am hoping someone better versed than myself could help me with them.


      Two questions, first, is it possible to autorun an Air app from a usb flash pen? I'm aware after reading a doc by Mike Chambers that you can apply to redistribute the runtime and modify to it run your app without installing it. Is it possible as well to autorun this app. The idea is that as soon as the user inserts the flash pen, the app would autorun and popup into focus, without user interaction.


      Second, the app would require an import mechanism for iTunes. I've seen a few examples wherein people are successfully decoding the XML disaster that is the iTunes library and reading in songs etc into a mini AS3 Air iTunes. I'm hoping the reverse of this would be possible where a user could hit a button and the app would 'import' say 3 tracks, stored on the pen, into the iTunes library.


      I'm new to this so bear with me if these are stupid questions. To do this i should think i have to be able to a) locate and edit the iTunes Library XML file with new entries, updating the iTunes Library and b) take the mp3 files on the flash pen, and save them to the location on the user's disk, referenced in my new created iTunes XML entries.


      Is this possible? Are there any security bars at play to stop you from storing mp3 files on the users hard-drive in a specific location?  Is there any way to account for these or overcome them?


      TL;DR: Is it possible to a) autorun an Adobe Air app from a flash pen and b) is it possible to import tracks into iTunes from an Air app wherein the iTunes library XML is edited and the mp3 files are stored in a specific location, on the users hard-drive?


      Any advice on the above would be greatly appreciated.

        • 1. Re: Getting started with Air (iTunes integration/autorun questions)
          Joe ... Ward Level 4

          A. You can use autorun to automatically start the installation of an AIR application. You can't run an AIR app without installing it. Note that you should be able to accomplish your goal with a Flash projector file, which IS a standalone executable. (This would not have access to any AIR APIs; you would be limited to the standard Flash Player APIS.)


          B. Yes, you can read, write, and create files as long as the user account running the program has sufficient privileges. I can't speculate on how likely you are to mess up the iTunes file, though. For a Flash projector, you must compile the SWF so that it has local filesystem access. This precludes network access.