Packageflash.events
Classpublic class ActivityEvent
InheritanceActivityEvent Inheritance Event Inheritance Object

Flash Player dispatches an ActivityEvent object whenever a camera or microphone reports that it has become active or inactive. There is only one type of activity event: ActivityEvent.ACTIVITY.

View the examples.

See also
ActivityEvent.ACTIVITY


Public Constants
Hide Inherited Public Constants
Show Inherited Public Constants
 PropertyDefined by
 InheritedACTIVATE : String = "activate"
[static] Dispatched when Flash Player gains operating system focus and becomes active.
Event
  ACTIVITY : String = "activity"
[static] Flash Player dispatches the activity event when a device, such as a camera or microphone, begins or ends a session.
ActivityEvent
 InheritedADDED : String = "added"
[static] Dispatched when a display object is added to the display list.
Event
 InheritedCANCEL : String = "cancel"
[static] Dispatched when a file upload or download is cancelled by the user.
Event
 InheritedCHANGE : String = "change"
[static] Dispatched after a control's value is modified.
Event
 InheritedCLOSE : String = "close"
[static] Dispatched by an Socket or XMLSocket object after a network connection is closed.
Event
 InheritedCOMPLETE : String = "complete"
[static] Dispatched when data has loaded successfully.
Event
 InheritedCONNECT : String = "connect"
[static] Dispatched when a network connection has been established.
Event
 InheritedDEACTIVATE : String = "deactivate"
[static] Dispatched when Flash Player loses operating system focus and is becoming inactive.
Event
 InheritedENTER_FRAME : String = "enterFrame"
[static] Dispatched when the playhead is entering a new frame.
Event
 InheritedID3 : String = "id3"
[static] Dispatched by a Sound object when ID3 data is available for an MP3 sound.
Event
 InheritedINIT : String = "init"
[static] Dispatched by a LoaderInfo object when the properties and methods of a loaded SWF file are accessible.
Event
 InheritedMOUSE_LEAVE : String = "mouseLeave"
[static] Dispatched by the Stage object when the mouse pointer moves out of the Flash Player window area.
Event
 InheritedOPEN : String = "open"
[static] Dispatched by a LoaderInfo, URLLoader, URLStream or FileReference object when a network operation starts.
Event
 InheritedREMOVED : String = "removed"
[static] Dispatched when a display object is about to be removed from the display list.
Event
 InheritedRENDER : String = "render"
[static] Dispatched when the display list is about to be updated and rendered.
Event
 InheritedRESIZE : String = "resize"
[static] Dispatched when scaleMode property of the Stage object is set to StageScaleMode.NO_SCALE and the SWF file has been resized.
Event
 InheritedSCROLL : String = "scroll"
[static] Dispatched by a TextField object after the user scrolls.
Event
 InheritedSELECT : String = "select"
[static] Dispatched by a FileReference object when an item has been selected.
Event
 InheritedSOUND_COMPLETE : String = "soundComplete"
[static] Dispatched by a Sound object when a sound has finished playing.
Event
 InheritedTAB_CHILDREN_CHANGE : String = "tabChildrenChange"
[static] Dispatched by an InteractiveObject instance when the value of the object's tabChildren flag changes.
Event
 InheritedTAB_ENABLED_CHANGE : String = "tabEnabledChange"
[static] Dispatched by an InteractiveObject instance when the the object's tabEnabled flag changes.
Event
 InheritedTAB_INDEX_CHANGE : String = "tabIndexChange"
[static] Dispatched by an InteractiveObject instance when the value of the object's tabIndex property changes.
Event
 InheritedUNLOAD : String = "unload"
[static] Dispatched by a LoaderInfo object whenever a loaded object is removed using the unload() method of the Loader object, or when a second load is performed by the same Loader object and the orignal content is removed prior to the load beginning.
Event
Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties
 PropertyDefined by
  activating : Boolean
Indicates whether the device is activating (true) or deactivating (false).
ActivityEvent
 Inheritedbubbles : Boolean
Indicates whether an event is a bubbling event.
Event
 Inheritedcancelable : Boolean
Indicates whether the behavior associated with the event can be prevented.
Event
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheritedcurrentTarget : Object
Indicates the object that is actively processing the Event object with an event listener.
Event
 InheritedeventPhase : uint
Indicates the current phase in the event flow.
Event
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 Inheritedtarget : Object
Indicates the event target.
Event
 Inheritedtype : String
Indicates the type of event.
Event
Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods
 FunctionDefined by
  
ActivityEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, activating:Boolean = false)
Creates an event object that contains information about activity events.
ActivityEvent
  
Creates a copy of an ActivityEvent object and sets the value of each property to match that of the original.
ActivityEvent
 Inherited
formatToString(className:String, ... arguments):String
A utility function that you use to implement the toString() method in your custom Event class.
Event
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
This method checks whether preventDefault() has been called on the event and returns true if preventDefault() has been called and false otherwise.
Event
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Cancels an event's default behavior if that behavior can be cancelled.
Event
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.
Event
 Inherited
Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.
Event
  
Returns a string that contains all the properties of the ActivityEvent object.
ActivityEvent
 Inherited
Returns the primitive value of the specified object.
Object
Constant detail
ACTIVITY constant
public static const ACTIVITY:String = "activity"

Flash Player dispatches the activity event when a device, such as a camera or microphone, begins or ends a session.

This event has the following characteristics:

PropertiesValues
targetThe object beginning or ending a session, such as a Camera or Microphone object. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event.
bubblesNo.
currentTargetIndicates the object that is actively processing the Event object with an event listener.
cancelableNo. There is no default behavior to cancel.

See also
flash.media.Camera, flash.media.Microphone
Property detail
activating property
activating:Boolean  [read-write]

Indicates whether the device is activating (true) or deactivating (false).

Implementation
    public function get activating():Boolean
    public function set activating(value:Boolean):void
Constructor detail
ActivityEvent constructor

public function ActivityEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, activating:Boolean = false)

Creates an event object that contains information about activity events. Event objects are passed as parameters to Event listeners.

Parameters
type:String — The type of the event. Event listeners can access this information through the inherited type property. There is only one type of activity event: ActivityEvent.ACTIVITY.
bubbles:Boolean (default = false) — Determines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property.
cancelable:Boolean (default = false) — Determines whether the Event object can be cancelled. Event listeners can access this information through the inherited cancelable property.
activating:Boolean (default = false) — Indicates whether the device is activating (true) or deactivating (false). Event listeners can access this information through the activating property.

See also
ActivityEvent.ACTIVITY
Method detail
clone method

public override function clone():Event

Creates a copy of an ActivityEvent object and sets the value of each property to match that of the original.

Returns
Event — A new ActivityEvent object with property values that match those of the original.
toString method

public override function toString():String

Returns a string that contains all the properties of the ActivityEvent object. The following format is used:

[ActivityEvent type=value bubbles=value cancelable=value activating=value]

Returns
String — A string that contains all the properties of the ActivityEvent object.
Class examples

The following example demonstrates the use of the ActivityEvent class by attaching an event listener method named activityHandler() to the microphone and generating text information every time the microphone generates an activity event.

package {
    import flash.display.Sprite;
    import flash.events.ActivityEvent;
    import flash.media.Microphone;

    public class ActivityEventExample extends Sprite {
        public function ActivityEventExample() {
            var mic:Microphone = Microphone.getMicrophone();
            mic.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
        }

        private function activityHandler(event:ActivityEvent):void {
            trace("event: " + event);
            trace("event.activating: " + event.activating);
        }
    }
}




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/flashauthoringpreview/flash/events/ActivityEvent.html