Packageflash.permissions
Classpublic final class PermissionManager
InheritancePermissionManager Inheritance EventDispatcher Inheritance Object

Language version: ActionScript 3.0
Runtime version: AIR 33.1

A PermissionManager object provides access to information about operating system permissions for a restricted resource such as camera or microphone. Due to changes in OS security and privacy, this is required to be tested/requested prior to the AIR runtime attempting to find out any information about the resource in question; so relevant classes will provide a PermissionManager as a static class member so that applications can use this without having to first create an instance of the class. Whether permissions has been granted (or isn't needed), or denied, can be checked using the permissionStatus property. If this is 'unknown' then use the requestPermission() method to trigger an OS-specific request to the user. Once the user has responded, a PermissionEvent will be dispatched.

See also

flash.media.Camera.permissionManager
flash.media.Microphone.permissionManager


Public Properties
 PropertyDefined by
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  permissionStatus : String
[read-only] Determine whether the application has been granted the permission to use resource.
PermissionManager
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  resourceType : String
[read-only] Which resource this PermissionManager instance is responsible for
PermissionManager
Public Methods
 MethodDefined by
 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
  
Requests permission for the application to use the resource.
PermissionManager
 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
 EventSummaryDefined by
 Inherited [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
   Dispatched when the application receives a change in permission from the OS.PermissionManager
Property detail
permissionStatusproperty
permissionStatus:String  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 33.1

Determine whether the application has been granted the permission to use resource.

Implementation
    public function get permissionStatus():String

See also

resourceTypeproperty 
resourceType:String  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 33.1

Which resource this PermissionManager instance is responsible for

Implementation
    public function get resourceType():String
Method detail
requestPermission()method
public function requestPermission():void

Language version: ActionScript 3.0
Runtime version: AIR 33.1

Requests permission for the application to use the resource.


Events
PermissionStatus:PermissionEvent — dispatched when the requested permission is granted/denied by the user.
Event detail
permissionStatusevent 
Event object type: flash.events.PermissionEvent

Language version: ActionScript 3.0
Runtime version: AIR 33.1

Dispatched when the application receives a change in permission from the OS. Check the value of status property to determine whether the permission was granted or denied

See also