Load External JPG into SWF on Android
I have my new HTC Desire Android phone for over a week now and I have been building little Flash apps here and there. Uisng the latest Flash CS5 with the AR 2.5 extension and the lab preview of Flash Builder, I found the experience very pleasant.
In my previous posts, I have talked about the new AS3 event models for mobile phones and how similar it is to the mouse events model. In this post I would like to show how to load external photos sitting in the SD card into a mobile Flash apps running on Android 2.2. Try the code below:
var fileChooser:File = File.userDirectory;
var pic:Loader = new Loader();
As you can see from above, the code is exactly like what you would expect for a standard AIR app. Again, you can also add FileFilter to limit to file types to be displayed on the file dialog box. Of course, there are differences between developing desktop vs mobile apps. But your AS3 skills can help a long way in building Android and iOS apps.