Adobe® Flex® 4 Language Reference
Show Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
flash.media 
CameraRoll 
Packageflash.media
Classpublic class CameraRoll
InheritanceCameraRoll Inheritance EventDispatcher Inheritance Object

Language Version: ActionScript 3.0
Runtime Versions: AIR 2

The CameraRoll class allows you to save image data to a system's "camera roll."

This class is only supported in mobile profile AIR applications. The CameraRoll.addBitmapData() method adds an image to the device's camera roll. To check at run time whether your application supports the CameraRoll.addBitmapData() method, check the CameraRoll.supportsAddBitmapData property.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  AIR-only supportsAddBitmapData : Boolean
[static] [read-only] Whether the CameraRoll.addBitmapData() method is supported.
CameraRoll
Public Methods
 MethodDefined By
  
Creates a CameraRoll object.
CameraRoll
  
Adds an image to the iPhone camera roll.
CameraRoll
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
  Signals that a CameraRoll operation completed successfully.CameraRoll
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
  Indicates that an error occurred during an CameraRoll operation.CameraRoll
Property Detail
AIR-only 

supportsAddBitmapData

property
supportsAddBitmapData:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 2

Whether the CameraRoll.addBitmapData() method is supported. Currently, the method is only supported in mobile profile AIR applications.



Implementation
    public static function get supportsAddBitmapData():Boolean
Constructor Detail
AIR-only 

CameraRoll

()Constructor
public function CameraRoll()

Language Version: ActionScript 3.0
Runtime Versions: AIR 2

Creates a CameraRoll object.

There is only a single "camera roll." All CameraRoll objects save to the same image repository.

Method Detail

AIR-only addBitmapData

()method
public function addBitmapData(bitmapData:BitmapData):void

Language Version: ActionScript 3.0
Runtime Versions: AIR 2

Adds an image to the iPhone camera roll.

To check at run time whether your application supports the CameraRoll.addBitmapData() method, check the CameraRoll.supportsAddBitmapData property.

Parameters

bitmapData:BitmapData — a BitmapData object containing the image to send to the camera roll.

Event Detail
AIR-only 

complete

Event
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.COMPLETE

Runtime Versions: AIR 2

Signals that a CameraRoll operation completed successfully.

The Event.COMPLETE constant defines the value of the type property of a complete event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object that has completed loading.
AIR-only 

error

Event  
Event Object Type: flash.events.ErrorEvent
property ErrorEvent.type = flash.events.ErrorEvent.ERROR

Runtime Versions: AIR 2

Indicates that an error occurred during an CameraRoll operation.

Defines the value of the type property of an error event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object experiencing a network operation failure.
textText to be displayed as an error message.