O'Reilly logo

Flash Development for Android Cookbook by Joseph Labrecque

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading photographs from the device cameraRoll

The Android operating system has a central repository for storing photographs captured by the variety of camera applications a user may have installed. There are APIs within AIR for Android, which allows a Flash developer to specifically target and pull from this repository for display within an application.

How to do it…

We must use the mobile CameraRoll API to browse directly to the device camera roll and select a photograph for display:

  1. First, import the following classes into your project:
    import flash.display.Loader; import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.events.MediaEvent; import flash.events.TouchEvent; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required