flash.eventsNetMonitorEvent A NetMonitor object dispatches NetMonitorEvent objects when a NetStream object is created.flash.events:Event A NetMonitor object dispatches NetMonitorEvent objects when a NetStream object is created. netStreamCreateflash.events:NetMonitorEvent:NET_STREAM_CREATEflash.events:NetMonitorEventNetMonitorEvent Creates an event object that contains information about netStreamCreate events.typeStringThe type of the event. Event listeners can access this information through the inherited type property. There is only one type of event: NetMonitorEvent.NET_STREAM_CREATE. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. netStreamflash.net:NetStreamnullThe new NetStream object that has been created. Event listeners can access this information through the netStream property. Constructor for NetMonitorEvent objects. Creates an event object that contains information about netStreamCreate events. Event objects are passed as parameters to Event listeners. NetMonitorEvent.NET_STREAM_CREATEclone Creates a copy of an NetMonitorEvent object and sets the value of each property to match that of the original.A new NetMonitorEvent object with property values that match those of the original. flash.events:Event Creates a copy of an NetMonitorEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the NetMonitorEvent object.A string that contains all the properties of NetMonitorEvent object. String Returns a string that contains all the properties of the NetMonitorEvent object. The following format is used:

[NetMonitorEvent type=value bubbles=value cancelable=value netStream=value]

NET_STREAM_CREATE The NetMonitorEvent.NET_STREAM_CREATE constant defines the value of the type property of an netStreamCreate event object.netStreamCreateString The NetMonitorEvent.NET_STREAM_CREATE constant defines the value of the type property of an netStreamCreate event object.

The netStreamCreate event has the following properties:

PropertyValuenetStreamNetStream object that has been created.bubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object beginning or ending a session.
netStream The new NetStream object.flash.net:NetStream The new NetStream object.
TimerEvent A Timer object dispatches a TimerEvent objects whenever the Timer object reaches the interval specified by the Timer.delay property.Event objects for Timer events. flash.events:Event A Timer object dispatches a TimerEvent objects whenever the Timer object reaches the interval specified by the Timer.delay property. The following example uses the TimerExample class to show how a listener method timerHandler() can be instantiated and set to listen for a new TimerEvent to be dispatched, which happens when the Timer's start() method is called. package { import flash.utils.Timer; import flash.events.TimerEvent; import flash.display.Sprite; public class TimerEventExample extends Sprite { public function TimerEventExample() { var myTimer:Timer = new Timer(1000, 2); myTimer.addEventListener(TimerEvent.TIMER, timerHandler); myTimer.start(); } public function timerHandler(event:TimerEvent):void { trace("timerHandler: " + event); } } } flash.utils.TimertimerCompleteflash.events:TimerEvent:TIMER_COMPLETEflash.events:TimerEventflash.utils.Timer.timerCompletetimerflash.events:TimerEvent:TIMERflash.events:TimerEventflash.utils.Timer.timerTimerEvent Creates an Event object with specific information relevant to timer events.typeString The type of the event. Event listeners can access this information through the inherited type property. bubblesBooleanfalseDetermines whether the Event object bubbles. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Constructor for TimerEvent objects. Creates an Event object with specific information relevant to timer events. Event objects are passed as parameters to event listeners. clone Creates a copy of the TimerEvent object and sets each property's value to match that of the original.A new TimerEvent object with property values that match those of the original. flash.events:Event Creates a copy of the TimerEvent object and sets each property's value to match that of the original. toString Returns a string that contains all the properties of the TimerEvent object.A string that contains all the properties of the TimerEvent object. String Returns a string that contains all the properties of the TimerEvent object. The string is in the following format:

[TimerEvent type=value bubbles=value cancelable=value]

updateAfterEvent Instructs Flash Player or the AIR runtime to render after processing of this event completes, if the display list has been modified. Instructs Flash Player or the AIR runtime to render after processing of this event completes, if the display list has been modified. The following is an example for the TimerEvent.updateAfterEvent() method. function onTimer(event:TimerEvent):void { if (40 < my_mc.x && my_mc.x < 375) { my_mc.x-= 50; } else { my_mc.x=374; } event.updateAfterEvent(); } var moveTimer:Timer=new Timer(50,250); moveTimer.addEventListener(TimerEvent.TIMER,onTimer); moveTimer.start(); TIMER_COMPLETE Defines the value of the type property of a timerComplete event object.timerCompleteString Defines the value of the type property of a timerComplete event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe Timer object that has completed its requests.
flash.utils.Timer.timerComplete
TIMER Defines the value of the type property of a timer event object.timerString Defines the value of the type property of a timer event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe Timer object that has reached its interval.
flash.utils.Timer.timer
IOErrorEvent An IOErrorEvent object is dispatched when an error causes input or output operations to fail.Event objects for IOErrorEvent events. flash.events:ErrorEvent An IOErrorEvent object is dispatched when an error causes input or output operations to fail.

You can check for error events that do not have any listeners by using the debugger version of Flash Player or the AIR Debug Launcher (ADL). The string defined by the text parameter of the IOErrorEvent constructor is displayed.

The following example uses the IOErrorEventExample class to show how an error event object is dispatched when an attempt is made to load a nonexistent file. The example carries out the following tasks:
  1. The class constructor creates a new instance of a URLLoader object and assigns it to the variable loader.
  2. The URLLoader instance instantiates an event listener of type ioError, which has an associated subscriber method ioErrorHandler(), which simply prints information about the event using trace().
  3. Next, the constructor creates a new instance of a URLRequest object, request, passing MissingFile.xml so that the name and location of the missing file are known.
  4. The request variable is then passed to loader.load(), which attempts to load the missing file. Since the file is missing, the event handler dispatches an ioError event.

Notes:

  • You need to compile the SWF file with "Local Playback Security" set to "Access Local Files Only".
  • Make sure that you do not have a file named "MissingFile.xml" at the same level as your SWF file.

package { import flash.display.Sprite; import flash.events.IOErrorEvent; import flash.net.URLLoader; import flash.net.URLRequest; public class IOErrorEventExample extends Sprite { public function IOErrorEventExample() { var loader:URLLoader = new URLLoader(); loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); var request:URLRequest = new URLRequest("MissingFile.xml"); loader.load(request); } private function ioErrorHandler(event:IOErrorEvent):void { trace("ioErrorHandler: " + event); } } }
IO_ERRORioErrorflash.events:IOErrorEvent:IO_ERRORflash.events:IOErrorEventflash.display.LoaderInfo.ioErrorflash.media.Sound.ioErrorflash.net.SecureSocket.ioErrorflash.net.Socket.ioErrorflash.net.FileReference.ioErrorflash.net.NetConnection.ioErrorflash.net.NetStream.ioErrorflash.net.URLLoader.ioErrorflash.net.URLStream.ioErrorflash.net.XMLSocket.ioErrorIOErrorEventflash.events:IOErrorEvent:STANDARD_ERROR_IO_ERRORflash.events:IOErrorEventIOErrorEventflash.events:IOErrorEvent:STANDARD_INPUT_IO_ERRORflash.events:IOErrorEventIOErrorEventflash.events:IOErrorEvent:STANDARD_OUTPUT_IO_ERRORflash.events:IOErrorEventIOErrorEvent Creates an Event object that contains specific information about ioError events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of input/output error event: IOErrorEvent.IO_ERROR. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. textStringText to be displayed as an error message. Event listeners can access this information through the text property. idint0A reference number to associate with the specific error (supported in Adobe AIR only). Constructor for IOErrorEvent objects. Creates an Event object that contains specific information about ioError events. Event objects are passed as parameters to Event listeners. IO_ERRORclone Creates a copy of the IOErrorEvent object and sets the value of each property to match that of the original.A new IOErrorEvent object with property values that match those of the original. flash.events:Event Creates a copy of the IOErrorEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the IOErrorEvent object.A string that contains all the properties of the IOErrorEvent object. String Returns a string that contains all the properties of the IOErrorEvent object. The string is in the following format:

[IOErrorEvent type=value bubbles=value cancelable=value text=value errorID=value] The errorId is only available in Adobe AIR

IO_ERROR Defines the value of the type property of an ioError event object.ioErrorString Defines the value of the type property of an ioError event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.errorIDA reference number associated with the specific error (AIR only).targetThe network object experiencing the input/output error.textText to be displayed as an error message.
flash.display.LoaderInfo.ioErrorflash.media.Sound.ioErrorflash.net.SecureSocket.ioErrorflash.net.Socket.ioErrorflash.net.FileReference.ioErrorflash.net.NetConnection.ioErrorflash.net.NetStream.ioErrorflash.net.URLLoader.ioErrorflash.net.URLStream.ioErrorflash.net.XMLSocket.ioError
STANDARD_ERROR_IO_ERROR The standardErrorIoError event is dispatched when an error occurs while reading data from the standardError stream of a NativeProcess object.standardErrorIoErrorString The standardErrorIoError event is dispatched when an error occurs while reading data from the standardError stream of a NativeProcess object.

This event has the following properties:

PropertyValuebubblesNo.cancelableNo. There is no default behavior to cancel.errorIDThe reference number associated with the specific error.targetThe object on which the error occurred.textText to be displayed as an error message.
STANDARD_INPUT_IO_ERROR The standardInputIoError event is dispatched when an error occurs while writing data to the standardInput of a NativeProcess object.standardInputIoErrorString The standardInputIoError event is dispatched when an error occurs while writing data to the standardInput of a NativeProcess object.

This event has the following properties:

PropertyValuebubblesNo.cancelableNo. There is no default behavior to cancel.errorIDThe reference number associated with the specific error.targetThe object on which the error occurred.textText to be displayed as an error message.
STANDARD_OUTPUT_IO_ERROR The standardOutputIoError event is dispatched when an error occurs while reading data from the standardOutput stream of a NativeProcess object.standardOutputIoErrorString The standardOutputIoError event is dispatched when an error occurs while reading data from the standardOutput stream of a NativeProcess object.

This event has the following properties:

PropertyValuebubblesNo.cancelableNo. There is no default behavior to cancel.errorIDThe reference number associated with the specific error.targetThe object on which the error occurred.textText to be displayed as an error message.
NetStatusEvent A NetConnection, NetStream, or SharedObject object dispatches NetStatusEvent objects when a it reports its status.Event objects for NetStatusEvent events. flash.events:Event A NetConnection, NetStream, or SharedObject object dispatches NetStatusEvent objects when a it reports its status. There is only one type of status event: NetStatusEvent.NET_STATUS. The following example uses a Video object with the NetConnection and NetStream classes to load and play an FLV file.

In this example, the netStatusHandler method is registered as a listener for the NetStatusEvent event NetConnection.netStatus. When the status (success or failure) of the NetConnection.connect() attempt is determined, the netStatus event triggers this method. If the attempt to connect to the NetConnection object is successful (in other words, if the info property of the NetStatusEvent object dispatched by the netStatus event has a code property that indicates success), the code creates the Video and NetStream objects and calls the Video.attachNetStream() and NetStream.play() methods.

Note: To run this example, you need an FLV file whose name and location match the variable passed to videoURL; in this case, an FLV file called Video.flv that is in the same directory as the SWF file.

package { import flash.display.Sprite; import flash.events.*; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; public class NetStatusEventExample extends Sprite { private var videoURL:String = "Video.flv"; private var connection:NetConnection; private var stream:NetStream; public function NetStatusEventExample() { connection = new NetConnection(); connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); connection.connect(null); } private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case "NetConnection.Connect.Success": connectStream(); break; case "NetStream.Play.StreamNotFound": trace("Unable to locate video: " + videoURL); break; } } private function connectStream():void { var stream:NetStream = new NetStream(connection); stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); var video:Video = new Video(); video.attachNetStream(stream); stream.play(videoURL); addChild(video); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace("securityErrorHandler: " + event); } private function asyncErrorHandler(event:AsyncErrorEvent):void { // ignore AsyncErrorEvent events. } } }
flash.net.NetConnectionflash.net.NetStreamflash.net.SharedObjectNetStatusEvent.NET_STATUSnetStatusflash.events:NetStatusEvent:NET_STATUSflash.events:NetStatusEventflash.events.NetStatusEvent.infoflash.net.NetConnection.netStatusflash.net.NetStream.netStatusflash.net.SharedObject.netStatusNetStatusEvent Creates an Event object that contains information about netStatus events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of status event: NetStatusEvent.NET_STATUS. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. infoObjectnullAn object containing properties that describe the object's status. Event listeners can access this object through the info property. Constructor for NetStatusEvent objects. Creates an Event object that contains information about netStatus events. Event objects are passed as parameters to event listeners. flash.events.NetStatusEvent.NET_STATUSclone Creates a copy of the NetStatusEvent object and sets the value of each property to match that of the original.A new NetStatusEvent object with property values that match those of the original. flash.events:Event Creates a copy of the NetStatusEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the NetStatusEvent object.A string that contains all the properties of the NetStatusEvent object. String Returns a string that contains all the properties of the NetStatusEvent object. The string is in the following format:

[NetStatusEvent type=value bubbles=value cancelable=value info=value]

NET_STATUS Defines the value of the type property of a netStatus event object.netStatusString Defines the value of the type property of a netStatus event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.infoAn object with properties that describe the object's status or error condition.targetThe NetConnection or NetStream object reporting its status.
flash.events.NetStatusEvent.infoflash.net.NetConnection.netStatusflash.net.NetStream.netStatusflash.net.SharedObject.netStatus
info An object with properties that describe the object's status or error condition.Object An object with properties that describe the object's status or error condition.

The information object could have a code property containing a string that represents a specific event or a level property containing a string that is either "status" or "error".

The information object could also be something different. The code and level properties might not work for some implementations and some servers might send different objects.

P2P connections send messages to a NetConnection with a stream parameter in the information object that indicates which NetStream the message pertains to.

For example, Flex Data Services sends Message objects that cause coercion errors if you try to access the code or level property.

The following table describes the possible string values of the code and level properties.

Code propertyLevel propertyMeaning"NetConnection.Call.BadVersion""error"Packet encoded in an unidentified format."NetConnection.Call.Failed""error"The NetConnection.call() method was not able to invoke the server-side method or command."NetConnection.Call.Prohibited""error"An Action Message Format (AMF) operation is prevented for security reasons. Either the AMF URL is not in the same domain as the file containing the code calling the NetConnection.call() method, or the AMF server does not have a policy file that trusts the domain of the the file containing the code calling the NetConnection.call() method. "NetConnection.Connect.AppShutdown""error"The server-side application is shutting down."NetConnection.Connect.Closed""status"The connection was closed successfully."NetConnection.Connect.Failed""error"The connection attempt failed."NetConnection.Connect.IdleTimeout""status"Flash Media Server disconnected the client because the client was idle longer than the configured value for <MaxIdleTime>. On Flash Media Server, <AutoCloseIdleClients> is disabled by default. When enabled, the default timeout value is 3600 seconds (1 hour). For more information, see Close idle connections. "NetConnection.Connect.InvalidApp""error"The application name specified in the call to NetConnection.connect() is invalid."NetConnection.Connect.NetworkChange""status"

Flash Player has detected a network change, for example, a dropped wireless connection, a successful wireless connection,or a network cable loss.

Use this event to check for a network interface change. Don't use this event to implement your NetConnection reconnect logic. Use "NetConnection.Connect.Closed" to implement your NetConnection reconnect logic.

"NetConnection.Connect.Rejected""error"The connection attempt did not have permission to access the application."NetConnection.Connect.Success""status"The connection attempt succeeded."NetGroup.Connect.Failed""error"The NetGroup connection attempt failed. The info.group property indicates which NetGroup failed."NetGroup.Connect.Rejected""error"The NetGroup is not authorized to function. The info.group property indicates which NetGroup was denied."NetGroup.Connect.Succcess""status"The NetGroup is successfully constructed and authorized to function. The info.group property indicates which NetGroup has succeeded."NetGroup.LocalCoverage.Notify""status"Sent when a portion of the group address space for which this node is responsible changes."NetGroup.MulticastStream.PublishNotify""status"Sent when a new named stream is detected in NetGroup's Group. The info.name:String property is the name of the detected stream."NetGroup.MulticastStream.UnpublishNotify""status"Sent when a named stream is no longer available in the Group. The info.name:String property is name of the stream which has disappeared."NetGroup.Neighbor.Connect""status"Sent when a neighbor connects to this node. The info.neighbor:String property is the group address of the neighbor. The info.peerID:String property is the peer ID of the neighbor."NetGroup.Neighbor.Disconnect""status"Sent when a neighbor disconnects from this node. The info.neighbor:String property is the group address of the neighbor. The info.peerID:String property is the peer ID of the neighbor."NetGroup.Posting.Notify""status"Sent when a new Group Posting is received. The info.message:Object property is the message. The info.messageID:String property is this message's messageID."NetGroup.Replication.Fetch.Failed""status"Sent when a fetch request for an object (previously announced with NetGroup.Replication.Fetch.SendNotify) fails or is denied. A new attempt for the object will be made if it is still wanted. The info.index:Number property is the index of the object that had been requested."NetGroup.Replication.Fetch.Result""status"Sent when a fetch request was satisfied by a neighbor. The info.index:Number property is the object index of this result. The info.object:Object property is the value of this object. This index will automatically be removed from the Want set. If the object is invalid, this index can be re-added to the Want set with NetGroup.addWantObjects()."NetGroup.Replication.Fetch.SendNotify""status"Sent when the Object Replication system is about to send a request for an object to a neighbor.The info.index:Number property is the index of the object that is being requested."NetGroup.Replication.Request""status"Sent when a neighbor has requested an object that this node has announced with NetGroup.addHaveObjects(). This request must eventually be answered with either NetGroup.writeRequestedObject() or NetGroup.denyRequestedObject(). Note that the answer may be asynchronous. The info.index:Number property is the index of the object that has been requested. The info.requestID:int property is the ID of this request, to be used by NetGroup.writeRequestedObject() or NetGroup.denyRequestedObject()."NetGroup.SendTo.Notify""status"Sent when a message directed to this node is received. The info.message:Object property is the message. The info.from:String property is the groupAddress from which the message was received. The info.fromLocal:Boolean property is TRUE if the message was sent by this node (meaning the local node is the nearest to the destination group address), and FALSE if the message was received from a different node. To implement recursive routing, the message must be resent with NetGroup.sendToNearest() if info.fromLocal is FALSE."NetStream.Buffer.Empty""status"Flash Player is not receiving data quickly enough to fill the buffer. Data flow is interrupted until the buffer refills, at which time a NetStream.Buffer.Full message is sent and the stream begins playing again."NetStream.Buffer.Flush""status"Data has finished streaming, and the remaining buffer is emptied."NetStream.Buffer.Full""status"The buffer is full and the stream begins playing."NetStream.Connect.Closed""status"The P2P connection was closed successfully. The info.stream property indicates which stream has closed."NetStream.Connect.Failed""error"The P2P connection attempt failed. The info.stream property indicates which stream has failed."NetStream.Connect.Rejected""error"The P2P connection attempt did not have permission to access the other peer. The info.stream property indicates which stream was rejected."NetStream.Connect.Success""status"The P2P connection attempt succeeded. The info.stream property indicates which stream has succeeded."NetStream.DRM.UpdateNeeded""status"A NetStream object is attempting to play protected content, but the required Flash Access module is either not present, not permitted by the effective content policy, or not compatible with the current player. To update the module or player, use the update() method of flash.system.SystemUpdater. "NetStream.Failed""error"(Flash Media Server) An error has occurred for a reason other than those listed in other event codes. "NetStream.MulticastStream.Reset""status"A multicast subscription has changed focus to a different stream published with the same name in the same group. Local overrides of multicast stream parameters are lost. Reapply the local overrides or the new stream's default parameters will be used."NetStream.Pause.Notify""status"The stream is paused."NetStream.Play.Failed""error"An error has occurred in playback for a reason other than those listed elsewhere in this table, such as the subscriber not having read access."NetStream.Play.FileStructureInvalid""error"(AIR and Flash Player 9.0.115.0) The application detects an invalid file structure and will not try to play this type of file. "NetStream.Play.InsufficientBW""warning"(Flash Media Server) The client does not have sufficient bandwidth to play the data at normal speed. "NetStream.Play.NoSupportedTrackFound""error"(AIR and Flash Player 9.0.115.0) The application does not detect any supported tracks (video, audio or data) and will not try to play the file."NetStream.Play.PublishNotify""status"The initial publish to a stream is sent to all subscribers."NetStream.Play.Reset""status"Caused by a play list reset."NetStream.Play.Start""status"Playback has started."NetStream.Play.Stop""status"Playback has stopped."NetStream.Play.StreamNotFound""error"The file passed to the NetStream.play() method can't be found."NetStream.Play.Transition""status"(Flash Media Server 3.5) The server received the command to transition to another stream as a result of bitrate stream switching. This code indicates a success status event for the NetStream.play2() call to initiate a stream switch. If the switch does not succeed, the server sends a NetStream.Play.Failed event instead. When the stream switch occurs, an onPlayStatus event with a code of "NetStream.Play.TransitionComplete" is dispatched. For Flash Player 10 and later."NetStream.Play.UnpublishNotify""status"An unpublish from a stream is sent to all subscribers."NetStream.Publish.BadName""error"Attempt to publish a stream which is already being published by someone else."NetStream.Publish.Idle""status"The publisher of the stream is idle and not transmitting data."NetStream.Publish.Start""status"Publish was successful."NetStream.Record.AlreadyExists""status"The stream being recorded maps to a file that is already being recorded to by another stream. This can happen due to misconfigured virtual directories."NetStream.Record.Failed""error"An attempt to record a stream failed."NetStream.Record.NoAccess""error"Attempt to record a stream that is still playing or the client has no access right."NetStream.Record.Start""status"Recording has started."NetStream.Record.Stop""status"Recording stopped."NetStream.Seek.Failed""error"The seek fails, which happens if the stream is not seekable."NetStream.Seek.InvalidTime""error"For video downloaded progressively, the user has tried to seek or play past the end of the video data that has downloaded thus far, or past the end of the video once the entire file has downloaded. The info.details property of the event object contains a time code that indicates the last valid position to which the user can seek."NetStream.Seek.Notify""status"

The seek operation is complete.

Sent when NetStream.seek() is called on a stream in AS3 NetStream Data Generation Mode. The info object is extended to include info.seekPoint which is the same value passed to NetStream.seek().

"NetStream.Step.Notify""status"The step operation is complete."NetStream.Unpause.Notify""status"The stream is resumed."NetStream.Unpublish.Success""status"The unpublish operation was successfuul."SharedObject.BadPersistence""error"A request was made for a shared object with persistence flags, but the request cannot be granted because the object has already been created with different flags."SharedObject.Flush.Failed""error"The "pending" status is resolved, but the SharedObject.flush() failed."SharedObject.Flush.Success""status"The "pending" status is resolved and the SharedObject.flush() call succeeded."SharedObject.UriMismatch""error"An attempt was made to connect to a NetConnection object that has a different URI (URL) than the shared object.

If you consistently see errors regarding the buffer, try changing the buffer using the NetStream.bufferTime property.

The following example shows an event handler function that tests for the "NetStream.Seek.InvalidTime" error. The "NetStream.Seek.InvalidTime" error happens when the user attempts to seek beyond the end of the downloaded stream. The example tests the value of the event object's info.code property. In case the error occurs, the eventObj.info.details property is assigned to a variable to use as a parameter for the stream's seek() method. The eventObj.info.details contains the last valid position available to handle the error. So, the user goes to a valid location at the end of the downloaded stream. function videoStatus(eventObj:NetStatusEvent):Void { switch(eventObj.info.code) { case "NetStream.Seek.InvalidTime": { var validSeekTime:Number = eventObj.info.details; nStream.seek(validSeekTime); break; } } }
NetConnection classNetStream classNetGroup class
UncaughtErrorEvents The UncaughtErrorEvents class provides a way to receive uncaught error events.flash.events:EventDispatcher The UncaughtErrorEvents class provides a way to receive uncaught error events. An instance of this class dispatches an uncaughtError event when a runtime error occurs and the error isn't detected and handled in your code.

Use the following properties to access an UncaughtErrorEvents instance:

  • LoaderInfo.uncaughtErrorEvents: to detect uncaught errors in code defined in the same SWF.
  • Loader.uncaughtErrorEvents: to detect uncaught errors in code defined in the SWF loaded by a Loader object.

To catch an error directly and prevent an uncaught error event, do the following:

  • Use a try..catch block to isolate code that potentially throws a synchronous error
  • When performing an operation that dispatches an event when an error occurs, register a listener for that error event

If the content loaded by a Loader object is an AVM1 (ActionScript 2) SWF file, uncaught errors in the AVM1 SWF file do not result in an uncaughtError event. In addition, JavaScript errors in HTML content loaded in an HTMLLoader object (including a Flex HTML control) do not result in an uncaughtError event.

LoaderInfo.uncaughtErrorEventsLoader.uncaughtErrorEventsUncaughtErrorEventuncaughtError Dispatched when an error occurs and developer code doesn't detect and handle the error.flash.events.UncaughtErrorEvent.UNCAUGHT_ERRORflash.events.UncaughtErrorEvent Dispatched when an error occurs and developer code doesn't detect and handle the error. UncaughtErrorEvents Creates an UncaughtErrorEvents instance. Creates an UncaughtErrorEvents instance. Developer code shouldn't create UncaughtErrorEvents instances directly. To access an UncaughtErrorEvents object, use one of the following properties:
  • LoaderInfo.uncaughtErrorEvents: to detect uncaught errors in code defined in the same SWF.
  • Loader.uncaughtErrorEvents: to detect uncaught errors in code defined in the SWF loaded by a Loader object.
LoaderInfo.uncaughtErrorEventsLoader.uncaughtErrorEvents
MouseEvent A MouseEvent object is dispatched into the event flow whenever mouse events occur.Event objects for Mouse events. flash.events:Event A MouseEvent object is dispatched into the event flow whenever mouse events occur. A mouse event is usually generated by a user input device, such as a mouse or a trackball, that uses a pointer.

When nested nodes are involved, mouse events target the deepest possible nested node that is visible in the display list. This node is called the target node. To have a target node's ancestor receive notification of a mouse event, use EventDispatcher.addEventListener() on the ancestor node with the type parameter set to the specific mouse event you want to detect.

The following example uses the MouseEventExample and ChildSprite classes to show how mouse events are dispatched using a simple image. This example carries out the following tasks:
  1. The example declares properties for the size (100 x 100 pixels) and the background color (orange) for later use in drawing the square.
  2. The constructor creates a new ChildSprite object child. Its constructor first draws an orange 100 x 100 pixel square at coordinates (0,0) by calling its draw() method and then adds seven event listeners/subscribers.
    • click/clickHandler(): Dispatched when the user single-clicks with the left mouse button over the square.
    • doubleClick/doubleClickHandler(): Dispatched when the user double-clicks the left mouse button over the square.
    • mouseDown/mouseDownHandler(): When the ChildSprite object (the orange square) is clicked, a trace() message is printed to the screen, and then ChildSprite.draw() is called, which draws a dark yellow square in place of the light blue one drawn in mouseOverHandler(). The mouseDownHandler() method also adds a mouseMoveevent listener and the mouseMoveHandler() subscriber (described below), which processes the mouse moves. Then the startDrag() method is called, which allows the Sprite object to be dragged.
    • mouseOut/mouseOutHandler(): Dispatched whenever the pointer leaves the square area. The draw() method is called to return the square to its normal size and color.
    • mouseOver/mouseOverHandler(): Dispatched when the mouse pointer is over the square. This method redraws the square so that it is larger and its background color is dark yellow.
    • mouseUp/mouseUpHandler(): When the user releases the mouse button, the mouseMove event listener is removed and stopDrag is called, which freezes the square in place.
    • mouseMove/mouseMoveHandler(): Called as part of the mouseDownHandler() function, and dispatched when the user is pressing the left mouse button and dragging the square.
    • mouseWheel/mouseWheelHandler(): Dispatched when the user rotates the mouse wheel over the square.
  3. The ChildSprite instance child is then added to the display list by means of addChild(), which promptly draws the orange square.

Notes:

  • The MouseEventExample class should be the document root.
  • Some of the event methods listed above declare a local variable sprite, which is assigned the cast of event.target to type Sprite.
package { import flash.display.Sprite; public class MouseEventExample extends Sprite { private var size:uint = 100; private var bgColor:uint = 0xFFCC00; public function MouseEventExample() { var child:ChildSprite = new ChildSprite(); addChild(child); } } } import flash.display.Sprite; import flash.events.MouseEvent; class ChildSprite extends Sprite { private var size:uint = 50; private var overSize:uint = 60; private var backgroundColor:uint = 0xFFCC00; private var overColor:uint = 0xCCFF00; private var downColor:uint = 0x00CCFF; public function ChildSprite() { draw(size, size, backgroundColor); doubleClickEnabled = true; addEventListener(MouseEvent.CLICK, clickHandler); addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler); addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler); addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler); addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler); } private function draw(w:uint, h:uint, bgColor:uint):void { graphics.clear(); graphics.beginFill(bgColor); graphics.drawRect(0, 0, w, h); graphics.endFill(); } private function clickHandler(event:MouseEvent):void { trace("clickHandler"); } private function doubleClickHandler(event:MouseEvent):void { trace("doubleClickHandler"); } private function mouseDownHandler(event:MouseEvent):void { trace("mouseDownHandler"); draw(overSize, overSize, downColor); var sprite:Sprite = Sprite(event.target); sprite.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); sprite.startDrag(); } private function mouseMoveHandler(event:MouseEvent):void { trace("mouseMoveHandler"); event.updateAfterEvent(); } private function mouseOutHandler(event:MouseEvent):void { trace("mouseOutHandler"); draw(size, size, backgroundColor); } private function mouseOverHandler(event:MouseEvent):void { trace("mouseOverHandler"); draw(overSize, overSize, overColor); } private function mouseWheelHandler(event:MouseEvent):void { trace("mouseWheelHandler delta: " + event.delta); } private function mouseUpHandler(event:MouseEvent):void { trace("mouseUpHandler"); var sprite:Sprite = Sprite(event.target); sprite.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); sprite.stopDrag(); draw(overSize, overSize, overColor); } }
clickflash.events:MouseEvent:CLICKflash.events:MouseEventflash.display.InteractiveObject.clickcontextMenuflash.events:MouseEvent:CONTEXT_MENUflash.events:MouseEventdoubleClickflash.events:MouseEvent:DOUBLE_CLICKflash.events:MouseEventflash.display.InteractiveObject.doubleClickmiddleClickflash.events:MouseEvent:MIDDLE_CLICKflash.events:MouseEventflash.display.InteractiveObject.middleClickmiddleMouseDownflash.events:MouseEvent:MIDDLE_MOUSE_DOWNflash.events:MouseEventflash.display.InteractiveObject.middleMouseDownmiddleMouseUpflash.events:MouseEvent:MIDDLE_MOUSE_UPflash.events:MouseEventflash.display.InteractiveObject.middleMouseUpmouseDownflash.events:MouseEvent:MOUSE_DOWNflash.events:MouseEventflash.display.InteractiveObject.mouseDownmouseMoveflash.events:MouseEvent:MOUSE_MOVEflash.events:MouseEvent The following example is a simple drawing program. The user can draw on the main Sprite object or on a smaller rectangular Sprite object.

In the constructor, a rectangle innerRect Sprite object is created and the line style is set to green. The line style for drawing on the MouseEvent_MOUSE_MOVEExample Sprite container is set to red. Separate event listeners for the MouseEvent.MOUSE_UP and MouseEvent.MOUSE_DOWN events are added for the application's main Sprite object and innerRect Sprite object. In both cases, the mouse down event listener methods move the current drawing position to the mouse pointer's location and add a listener for the MouseEvent.MOUSE_MOVE event. When the mouse pointer is moved, the invoked event listener methods follows the pointer and draw a line using the graphics.LineTo() method. (Note: The innerRect Sprite object obscures the red lines of the main Sprite object that are drawn behind the rectangle.) When the MouseEvent.MOUSE_UP event occurs, the listener for the MOUSE_MOVE event is removed and drawing is stopped.

package { import flash.display.Sprite; import flash.display.Graphics; import flash.events.MouseEvent; public class MouseEvent_MOUSE_MOVEExample extends Sprite { private var innerRect:Sprite = new Sprite(); public function MouseEvent_MOUSE_MOVEExample() { graphics.lineStyle(3, 0xFF0000, 1); stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); innerRect.graphics.lineStyle(1, 0x00FF00, 1); innerRect.graphics.beginFill(0xFFFFFF); innerRect.graphics.drawRect(10, 10, 200, 200); innerRect.graphics.endFill(); innerRect.addEventListener(MouseEvent.MOUSE_DOWN, innerRectMouseDownHandler); innerRect.addEventListener(MouseEvent.MOUSE_UP, innerRectMouseUpHandler); addChild(innerRect); } private function mouseDownHandler(event:MouseEvent):void { graphics.moveTo(event.stageX, event.stageY); stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); } private function mouseMoveHandler(event:MouseEvent):void { graphics.lineTo(event.stageX, event.stageY); } private function mouseUpHandler(event:MouseEvent):void { stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); } private function innerRectMouseDownHandler(event:MouseEvent):void { innerRect.graphics.moveTo(event.localX, event.localY); innerRect.addEventListener(MouseEvent.MOUSE_MOVE, innerRectMouseMoveHandler); } private function innerRectMouseMoveHandler(event:MouseEvent):void { innerRect.graphics.lineTo(event.localX, event.localY); } private function innerRectMouseUpHandler(event:MouseEvent):void { innerRect.removeEventListener(MouseEvent.MOUSE_MOVE, innerRectMouseMoveHandler); } } }
flash.display.InteractiveObject.mouseMove
mouseOutflash.events:MouseEvent:MOUSE_OUTflash.events:MouseEventflash.display.InteractiveObject.mouseOutmouseOverflash.events:MouseEvent:MOUSE_OVERflash.events:MouseEventflash.display.InteractiveObject.mouseOvermouseUpflash.events:MouseEvent:MOUSE_UPflash.events:MouseEventflash.display.InteractiveObject.mouseUpmouseWheelflash.events:MouseEvent:MOUSE_WHEELflash.events:MouseEventflash.display.InteractiveObject.mouseWheelrightClickflash.events:MouseEvent:RIGHT_CLICKflash.events:MouseEventflash.display.InteractiveObject.rightClickRightMouseDownflash.events:MouseEvent:RIGHT_MOUSE_DOWNflash.events:MouseEventflash.display.InteractiveObject.rightMouseDownrightMouseUpflash.events:MouseEvent:RIGHT_MOUSE_UPflash.events:MouseEventflash.display.InteractiveObject.rightMouseUprollOutflash.events:MouseEvent:ROLL_OUTflash.events:MouseEventflash.display.InteractiveObject.rollOutrollOverflash.events:MouseEvent:ROLL_OVERflash.events:MouseEventflash.display.InteractiveObject.rollOverMouseEvent Creates an Event object that contains information about mouse events.typeString The type of the event. Possible values are: MouseEvent.CLICK, MouseEvent.DOUBLE_CLICK, MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_MOVE, MouseEvent.MOUSE_OUT, MouseEvent.MOUSE_OVER, MouseEvent.MOUSE_UP, MouseEvent.MIDDLE_CLICK, MouseEvent.MIDDLE_MOUSE_DOWN, MouseEvent.MIDDLE_MOUSE_UP, MouseEvent.RIGHT_CLICK, MouseEvent.RIGHT_MOUSE_DOWN, MouseEvent.RIGHT_MOUSE_UP, MouseEvent.MOUSE_WHEEL, MouseEvent.ROLL_OUT, and MouseEvent.ROLL_OVER. bubblesBooleantrue Determines whether the Event object participates in the bubbling phase of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. localXNumberunknownThe horizontal coordinate at which the event occurred relative to the containing sprite. localYNumberunknownThe vertical coordinate at which the event occurred relative to the containing sprite. relatedObjectflash.display:InteractiveObjectnullThe complementary InteractiveObject instance that is affected by the event. For example, when a mouseOut event occurs, relatedObject represents the display list object to which the pointing device now points. ctrlKeyBooleanfalseOn Windows or Linux, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. altKeyBooleanfalseIndicates whether the Alt key is activated (Windows or Linux only). shiftKeyBooleanfalseIndicates whether the Shift key is activated. buttonDownBooleanfalseIndicates whether the primary mouse button is pressed. deltaint0Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel. A positive delta value indicates an upward scroll; a negative value indicates a downward scroll. Typical values are 1 to 3, but faster rotation may produce larger values. This parameter is used only for the MouseEvent.mouseWheel event. commandKeyBooleanfalse(AIR only) Indicates whether the Command key is activated (Mac only). This parameter is used only for the MouseEvent.click, MouseEvent.mouseDown, MouseEvent.mouseUp, MouseEvent.middleClick, MouseEvent.middleMouseDown, MouseEvent.middleMouseUp, MouseEvent.rightClick, MouseEvent.rightMouseDown, MouseEvent.rightMouseUp, and MouseEvent.doubleClick events. This parameter is for Adobe AIR only; do not set it for Flash Player content. controlKeyBooleanfalse(AIR only) Indicates whether the Control or Ctrl key is activated. This parameter is used only for the MouseEvent.click, MouseEvent.mouseDown, MouseEvent.mouseUp, MouseEvent.middleClick, MouseEvent.middleMouseDown, MouseEvent.middleMouseUp, MouseEvent.rightClick, MouseEvent.rightMouseDown, MouseEvent.rightMouseUp, and MouseEvent.doubleClick events. This parameter is for Adobe AIR only; do not set it for Flash Player content. clickCountint0(AIR only) Indicates whether or not the mouse event is part of a multi-click sequence. This parameter will be zero for all mouse events other than MouseEvent.mouseDown, MouseEvent.mouseUp, MouseEvent.middleMouseDown, MouseEvent.middleMouseUp, MouseEvent.rightMouseDown and MouseEvent.rightMouseUp. Listening for single clicks, double clicks, or any multi-click sequence is possible with the clickCount parameter. This parameter is for Adobe AIR only; do not set it for Flash Player content. Constructor for MouseEvent objects. Creates an Event object that contains information about mouse events. Event objects are passed as parameters to event listeners. clone Creates a copy of the MouseEvent object and sets the value of each property to match that of the original.A new MouseEvent object with property values that match those of the original. flash.events:Event Creates a copy of the MouseEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the MouseEvent object.A string that contains all the properties of the MouseEvent object. String Returns a string that contains all the properties of the MouseEvent object. The string is in the following format:

[MouseEvent type=value bubbles=value cancelable=value ... delta=value]

updateAfterEvent Instructs Flash Player or Adobe AIR to render after processing of this event completes, if the display list has been modified. Instructs Flash Player or Adobe AIR to render after processing of this event completes, if the display list has been modified. CLICK Defines the value of the type property of a click event object.clickString Defines the value of the type property of a click event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDownFor click events, this value is always false.cancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.click
CONTEXT_MENU The MouseEvent.CONTEXT_MENU constant defines the value of the type property of a contextMenu event object.contextMenuString The MouseEvent.CONTEXT_MENU constant defines the value of the type property of a contextMenu event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the right mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.clickCountCount of the number of mouse clicks to indicate whether the event is part of a multi-click sequence.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
DOUBLE_CLICK Defines the value of the type property of a doubleClick event object.doubleClickString Defines the value of the type property of a doubleClick event object. The doubleClickEnabled property must be true for an object to generate the doubleClick event.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDownFor double-click events, this value is always false.cancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.doubleClick
MIDDLE_CLICK Defines the value of the type property of a middleClick event object.middleClickString Defines the value of the type property of a middleClick event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDownFor middle-click events, this property is always false.cancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.middleClick
MIDDLE_MOUSE_DOWN Defines the value of the type property of a middleMouseDown event object.middleMouseDownString Defines the value of the type property of a middleMouseDown event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the middle mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.clickCountCount of the number of mouse clicks to indicate whether the event is part of a multi-click sequence.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.middleMouseDown
MIDDLE_MOUSE_UP Defines the value of the type property of a middleMouseUp event object.middleMouseUpString Defines the value of the type property of a middleMouseUp event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the middle mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.clickCountCount of the number of mouse clicks to indicate whether the event is part of a multi-click sequence.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.middleMouseUp
MOUSE_DOWN Defines the value of the type property of a mouseDown event object.mouseDownString Defines the value of the type property of a mouseDown event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the primary mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows and Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.clickCountCount of the number of mouse clicks to indicate whether the event is part of a multi-click sequence.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
Please see the MOUSE_MOVE constant's example for an illustration of how to use this constant.
flash.display.InteractiveObject.mouseDown
MOUSE_MOVE Defines the value of the type property of a mouseMove event object.mouseMoveString Defines the value of the type property of a mouseMove event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the primary mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
The following example is a simple drawing program. The user can draw on the main Sprite object or on a smaller rectangular Sprite object.

In the constructor, a rectangle innerRect Sprite object is created and the line style is set to green. The line style for drawing on the MouseEvent_MOUSE_MOVEExample Sprite container is set to red. Separate event listeners for the MouseEvent.MOUSE_UP and MouseEvent.MOUSE_DOWN events are added for the application's main Sprite object and innerRect Sprite object. In both cases, the mouse down event listener methods move the current drawing position to the mouse pointer's location and add a listener for the MouseEvent.MOUSE_MOVE event. When the mouse pointer is moved, the invoked event listener methods follows the pointer and draw a line using the graphics.LineTo() method. (Note: The innerRect Sprite object obscures the red lines of the main Sprite object that are drawn behind the rectangle.) When the MouseEvent.MOUSE_UP event occurs, the listener for the MOUSE_MOVE event is removed and drawing is stopped.

package { import flash.display.Sprite; import flash.display.Graphics; import flash.events.MouseEvent; public class MouseEvent_MOUSE_MOVEExample extends Sprite { private var innerRect:Sprite = new Sprite(); public function MouseEvent_MOUSE_MOVEExample() { graphics.lineStyle(3, 0xFF0000, 1); stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); innerRect.graphics.lineStyle(1, 0x00FF00, 1); innerRect.graphics.beginFill(0xFFFFFF); innerRect.graphics.drawRect(10, 10, 200, 200); innerRect.graphics.endFill(); innerRect.addEventListener(MouseEvent.MOUSE_DOWN, innerRectMouseDownHandler); innerRect.addEventListener(MouseEvent.MOUSE_UP, innerRectMouseUpHandler); addChild(innerRect); } private function mouseDownHandler(event:MouseEvent):void { graphics.moveTo(event.stageX, event.stageY); stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); } private function mouseMoveHandler(event:MouseEvent):void { graphics.lineTo(event.stageX, event.stageY); } private function mouseUpHandler(event:MouseEvent):void { stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); } private function innerRectMouseDownHandler(event:MouseEvent):void { innerRect.graphics.moveTo(event.localX, event.localY); innerRect.addEventListener(MouseEvent.MOUSE_MOVE, innerRectMouseMoveHandler); } private function innerRectMouseMoveHandler(event:MouseEvent):void { innerRect.graphics.lineTo(event.localX, event.localY); } private function innerRectMouseUpHandler(event:MouseEvent):void { innerRect.removeEventListener(MouseEvent.MOUSE_MOVE, innerRectMouseMoveHandler); } } }
flash.display.InteractiveObject.mouseMove
MOUSE_OUT Defines the value of the type property of a mouseOut event object.mouseOutString Defines the value of the type property of a mouseOut event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the primary mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.relatedObjectThe display list object to which the pointing device now points.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.mouseOut
MOUSE_OVER Defines the value of the type property of a mouseOver event object.mouseOverString Defines the value of the type property of a mouseOver event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the primary mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.relatedObjectThe display list object to which the pointing device was pointing.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.mouseOver
MOUSE_UP Defines the value of the type property of a mouseUp event object.mouseUpString Defines the value of the type property of a mouseUp event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the primary mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.clickCountCount of the number of mouse clicks to indicate whether the event is part of a multi-click sequence.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
Please see the MOUSE_MOVE constant's example for an illustration of how to use this constant.
flash.display.InteractiveObject.mouseUp
MOUSE_WHEEL Defines the value of the type property of a mouseWheel event object.mouseWheelString Defines the value of the type property of a mouseWheel event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the primary mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.deltaThe number of lines that that each notch on the mouse wheel represents.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.mouseWheel
RIGHT_CLICK Defines the value of the type property of a rightClick event object.rightClickString Defines the value of the type property of a rightClick event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDownFor right-click events, this property is always false.cancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.rightClick
RIGHT_MOUSE_DOWN Defines the value of the type property of a rightMouseDown event object.rightMouseDownString Defines the value of the type property of a rightMouseDown event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDownFor right-click events, this property is always true.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.clickCountCount of the number of mouse clicks to indicate whether the event is part of a multi-click sequence.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.rightMouseDown
RIGHT_MOUSE_UP Defines the value of the type property of a rightMouseUp event object.rightMouseUpString Defines the value of the type property of a rightMouseUp event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblestruebuttonDowntrue if the right mouse button is pressed; false otherwise.cancelablefalse; the default behavior cannot be canceled.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.clickCountCount of the number of mouse clicks to indicate whether the event is part of a multi-click sequence.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.rightMouseUp
ROLL_OUT Defines the value of the type property of a rollOut event object.rollOutString Defines the value of the type property of a rollOut event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblesfalsebuttonDowntrue if the primary mouse button is pressed; false otherwise.cancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.relatedObjectThe display list object to which the pointing device now points.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.rollOut
ROLL_OVER Defines the value of the type property of a rollOver event object.rollOverString Defines the value of the type property of a rollOver event object.

This event has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows).bubblesfalsebuttonDowntrue if the primary mouse button is pressed; false otherwise.cancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.relatedObjectThe display list object to which the pointing device was pointing.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the pointing device. 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.
flash.display.InteractiveObject.rollOver
altKey Indicates whether the Alt key is active (true) or inactive (false).Boolean Indicates whether the Alt key is active (true) or inactive (false). Supported for Windows only. On other operating systems, this property is always set to false. buttonDown Indicates whether the primary mouse button is pressed (true) or not (false).Boolean Indicates whether the primary mouse button is pressed (true) or not (false). clickCount Indicates whether or not the mouse down event is part of a multi-click sequence.int Indicates whether or not the mouse down event is part of a multi-click sequence. This parameter will be zero for all mouse events other than MouseEvent.mouseDown, MouseEvent.mouseUp, MouseEvent.middleMouseDown, MouseEvent.middleMouseUp, MouseEvent.rightMouseDown, and MouseEvent.rightMouseUp. Listening for single clicks, double clicks, or any multi-click sequence is possible with the clickCount parameter. For example, an initial MouseEvent.mouseDown and MouseEvent.mouseUp will have a clickCount of 1, and the second MouseEvent.mouseDown and MouseEvent.mouseUp in a double-click sequence will have a clickCount of 2. If the mouse moves sufficiently or the multi-click sequence is interrupted for some reason, then the next MouseEvent.mouseDown will have a clickCount of 1. The doubleClick event will continue to fire as expected. commandKey Indicates whether the command key is activated (Mac only.) The value of property commandKey will have the same value as property ctrlKey on the Mac.Boolean Indicates whether the command key is activated (Mac only.)

The value of property commandKey will have the same value as property ctrlKey on the Mac. Always false on Windows or Linux.

controlKey Indicates whether the Control key is activated on Mac and whether the Ctrl key is activated on Windows or Linux.Boolean Indicates whether the Control key is activated on Mac and whether the Ctrl key is activated on Windows or Linux. ctrlKey On Windows or Linux, indicates whether the Ctrl key is active (true) or inactive (false).Boolean On Windows or Linux, indicates whether the Ctrl key is active (true) or inactive (false). On Macintosh, indicates whether either the Control key or the Command key is activated. delta Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel.int Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel. A positive delta value indicates an upward scroll; a negative value indicates a downward scroll. Typical values are 1 to 3, but faster rotation may produce larger values. This setting depends on the device and operating system and is usually configurable by the user. This property applies only to the MouseEvent.mouseWheel event. isRelatedObjectInaccessible If true, the relatedObject property is set to null for reasons related to security sandboxes.Boolean If true, the relatedObject property is set to null for reasons related to security sandboxes. If the nominal value of relatedObject is a reference to a DisplayObject in another sandbox, relatedObject is set to null unless there is permission in both directions across this sandbox boundary. Permission is established by calling Security.allowDomain() from a SWF file, or by providing a policy file from the server of an image file, and setting the LoaderContext.checkPolicyFile property when loading the image. MouseEvent.relatedObjectSecurity.allowDomain()LoaderContext.checkPolicyFilelocalX The horizontal coordinate at which the event occurred relative to the containing sprite.Number The horizontal coordinate at which the event occurred relative to the containing sprite. Please see the MOUSE_MOVE constant's example for an illustration of how to use this property. localY The vertical coordinate at which the event occurred relative to the containing sprite.Number The vertical coordinate at which the event occurred relative to the containing sprite. Please see the MOUSE_MOVE constant's example for an illustration of how to use this property. relatedObject A reference to a display list object that is related to the event.flash.display:InteractiveObject A reference to a display list object that is related to the event. For example, when a mouseOut event occurs, relatedObject represents the display list object to which the pointing device now points. This property applies to the mouseOut, mouseOver, rollOut, and rollOver events.

The value of this property can be null in two circumstances: if there no related object, or there is a related object, but it is in a security sandbox to which you don't have access. Use the isRelatedObjectInaccessible() property to determine which of these reasons applies.

MouseEvent.isRelatedObjectInaccessible
shiftKey Indicates whether the Shift key is active (true) or inactive (false).Boolean Indicates whether the Shift key is active (true) or inactive (false). stageX The horizontal coordinate at which the event occurred in global Stage coordinates.Number The horizontal coordinate at which the event occurred in global Stage coordinates. This property is calculated when the localX property is set. Please see the MOUSE_MOVE constant's example for an illustration of how to use this property. stageY The vertical coordinate at which the event occurred in global Stage coordinates.Number The vertical coordinate at which the event occurred in global Stage coordinates. This property is calculated when the localY property is set. Please see the MOUSE_MOVE constant's example for an illustration of how to use this property.
IEventDispatcher The IEventDispatcher interface defines methods for adding or removing event listeners, checks whether specific types of event listeners are registered, and dispatches events. The IEventDispatcher interface defines methods for adding or removing event listeners, checks whether specific types of event listeners are registered, and dispatches events.

Event targets are an important part of the Flash® Player and Adobe AIR event model. The event target serves as the focal point for how events flow through the display list hierarchy. When an event such as a mouse click or a keypress occurs, an event object is dispatched into the event flow from the root of the display list. The event object makes a round-trip journey to the event target, which is conceptually divided into three phases: the capture phase includes the journey from the root to the last node before the event target's node; the target phase includes only the event target node; and the bubbling phase includes any subsequent nodes encountered on the return trip to the root of the display list.

In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already extending another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member, and write simple hooks to route calls into the aggregated EventDispatcher.

The following example uses the IEventDispatcherExample and DecoratedDispatcher sample classes to show how the IEventDispatcher class can be implemented and used. The example accomplishes this by implementing each method of DecoratedDispatcher in the same manner as in EventDispatcher. Within the constructor for IEventDispatcherExample, a new instance (named decorDispatcher) of the DecoratedDispatcher class is constructed and the decorDispatcher variable is used to call addEventListener() with the custom event doSomething, which is then handled by didSomething(), which prints a line of text using trace(). package { import flash.events.Event; import flash.display.Sprite; public class IEventDispatcherExample extends Sprite { public function IEventDispatcherExample() { var decorDispatcher:DecoratedDispatcher = new DecoratedDispatcher(); decorDispatcher.addEventListener("doSomething", didSomething); decorDispatcher.dispatchEvent(new Event("doSomething")); } public function didSomething(evt:Event):void { trace(">> didSomething"); } } } import flash.events.IEventDispatcher; import flash.events.EventDispatcher; import flash.events.Event; class DecoratedDispatcher implements IEventDispatcher { private var dispatcher:EventDispatcher; public function DecoratedDispatcher() { dispatcher = new EventDispatcher(this); } public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void{ dispatcher.addEventListener(type, listener, useCapture, priority); } public function dispatchEvent(evt:Event):Boolean{ return dispatcher.dispatchEvent(evt); } public function hasEventListener(type:String):Boolean{ return dispatcher.hasEventListener(type); } public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void{ dispatcher.removeEventListener(type, listener, useCapture); } public function willTrigger(type:String):Boolean { return dispatcher.willTrigger(type); } }
addEventListener Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.typeStringThe type of event. listenerFunctionThe listener function that processes the event. This function must accept an event object as its only parameter and must return nothing, as this example shows:

function(evt:Event):void

The function can have any name.
useCaptureBooleanfalseDetermines whether the listener works in the capture phase or the target and bubbling phases. If useCapture is set to true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture is false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call addEventListener() twice, once with useCapture set to true, then again with useCapture set to false. priorityint0The priority level of the event listener. Priorities are designated by a 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0. useWeakReferenceBooleanfalseDetermines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not.

Class-level member functions are not subject to garbage collection, so you can set useWeakReference to true for class-level member functions without subjecting them to garbage collection. If you set useWeakReference to true for a listener that is a nested inner function, the function will be garbge-collected and no longer persistent. If you create references to the inner function (save it in another variable) then it is not garbage-collected and stays persistent.

Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. You can register event listeners on all nodes in the display list for a specific type of event, phase, and priority.

After you successfully register an event listener, you cannot change its priority through additional calls to addEventListener(). To change a listener's priority, you must first call removeEventListener(). Then you can register the listener again with the new priority level.

After the listener is registered, subsequent calls to addEventListener() with a different value for either type or useCapture result in the creation of a separate listener registration. For example, if you first register a listener with useCapture set to true, it listens only during the capture phase. If you call addEventListener() again using the same listener object, but with useCapture set to false, you have two separate listeners: one that listens during the capture phase, and another that listens during the target and bubbling phases.

You cannot register an event listener for only the target phase or the bubbling phase. Those phases are coupled during registration because bubbling applies only to the ancestors of the target node.

When you no longer need an event listener, remove it by calling EventDispatcher.removeEventListener(); otherwise, memory problems might result. Objects with registered event listeners are not automatically removed from memory because the garbage collector does not remove objects that still have references.

Copying an EventDispatcher instance does not copy the event listeners attached to it. (If your newly created node needs an event listener, you must attach the listener after creating the node.) However, if you move an EventDispatcher instance, the event listeners attached to it move along with it.

If the event listener is being registered on a node while an event is also being processed on this node, the event listener is not triggered during the current phase but may be triggered during a later phase in the event flow, such as the bubbling phase.

If an event listener is removed from a node while an event is being processed on the node, it is still triggered by the current actions. After it is removed, the event listener is never invoked again (unless it is registered again for future processing).

dispatchEvent Dispatches an event into the event flow.A value of true unless preventDefault() is called on the event, in which case it returns false. Booleaneventflash.events:EventThe event object dispatched into the event flow. Dispatches an event into the event flow. The event target is the EventDispatcher object upon which dispatchEvent() is called. hasEventListener Checks whether the EventDispatcher object has any listeners registered for a specific type of event.A value of true if a listener of the specified type is registered; false otherwise. BooleantypeStringThe type of event. Checks whether the EventDispatcher object has any listeners registered for a specific type of event. This allows you to determine where an EventDispatcher object has altered handling of an event type in the event flow hierarchy. To determine whether a specific event type will actually trigger an event listener, use IEventDispatcher.willTrigger().

The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter.

willTrigger()
removeEventListener Removes a listener from the EventDispatcher object.typeStringThe type of event. listenerFunctionThe listener object to remove. useCaptureBooleanfalseSpecifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both: one call with useCapture set to true, and another call with useCapture set to false. Removes a listener from the EventDispatcher object. If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect. willTrigger Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.A value of true if a listener of the specified type will be triggered; false otherwise. BooleantypeStringThe type of event. Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. This method returns true if an event listener is triggered during any phase of the event flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants.

The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter.

SQLErrorEvent A SQLErrorEvent instance is dispatched by a SQLConnection instance or SQLStatement instance when an error occurs while performing a database operation in asynchronous execution mode.flash.events:ErrorEvent A SQLErrorEvent instance is dispatched by a SQLConnection instance or SQLStatement instance when an error occurs while performing a database operation in asynchronous execution mode. The SQLErrorEvent instance that's passed as an event object to listeners provides access to information about the cause of the error and the operation that was being attempted.

The specific details of the failure can be found on the SQLError object in the SQLErrorEvent instance's error property.

flash.errors.SQLErrorflash.data.SQLConnectionflash.data.SQLStatementerrorflash.events:SQLErrorEvent:ERRORflash.events:SQLErrorEventflash.data.SQLConnectionflash.data.SQLStatementflash.errors.SQLErrorSQLErrorEvent Creates a SQLErrorEvent object to pass as an argument to event listeners.typeString The type of the event, accessible in the type property. The SQLErrorEvent defines one event type, the error event, represented by the SQLErrorEvent.ERROR constant. bubblesBooleanfalse Determines whether the event object participates in the bubbling stage of the event flow. The default value is false. cancelableBooleanfalseDetermines whether the Event object can be cancelled. The default value is false. errorflash.errors:SQLErrornullThe SQLError object that contains the details of the error. Used to create new SQLErrorEvent object. Creates a SQLErrorEvent object to pass as an argument to event listeners. flash.errors.SQLError;ERRORclone Creates a copy of the SQLErrorEvent object and sets the value of each property to match that of the original.A new SQLErrorEvent object with property values that match those of the original. flash.events:Event Creates a copy of the SQLErrorEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the SQLErrorEvent object.A string that contains all the properties of the SQLErrorEvent object. String Returns a string that contains all the properties of the SQLErrorEvent object. The string is in the following format:

[SQLErrorEvent type=value bubbles=value cancelable=value error=value]

The error value has the following format: SQLError : message value code=value operation=value

ERROR The SQLErrorEvent.ERROR constant defines the value of the type property of an error event dispatched when a call to a method of a SQLConnection or SQLStatement instance completes with an error.errorString The SQLErrorEvent.ERROR constant defines the value of the type property of an error event dispatched when a call to a method of a SQLConnection or SQLStatement instance completes with an error. The error event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.errorA SQLError object containing information about the type of error that occurred and the operation that caused the error.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection or SQLStatement object reporting the error. flash.data.SQLConnectionflash.data.SQLStatementflash.errors.SQLErrorerror A SQLError object containing detailed information about the cause of the error.flash.errors:SQLError A SQLError object containing detailed information about the cause of the error.
ErrorEvent An object dispatches an ErrorEvent object when an error causes an asynchronous operation to fail.Event objects for ErrorEvent events. flash.events:TextEvent An object dispatches an ErrorEvent object when an error causes an asynchronous operation to fail.

The ErrorEvent class defines only one type of error event: ErrorEvent.ERROR. The ErrorEvent class also serves as the base class for several other error event classes, including the AsyncErrorEvent, IOErrorEvent, SecurityErrorEvent, SQLErrorEvent, and UncaughtErrorEvent classes.

You can check for error events that do not have any listeners by registering a listener for the uncaughtError (UncaughtErrorEvent.UNCAUGHT_ERROR) event.

An uncaught error also causes an error dialog box displaying the error event to appear when content is running in the debugger version of Flash Player or the AIR Debug Launcher (ADL) application.

The following example demonstrates the use of a single error handler (errorHandler()) that captures multiple types of error events. If there is an ioError event, the handler attempts to load from the network, which then throws a securityError.

Note: This example does not work if you have a file named MissingFile.xml in the same directory as your SWF file.

package { import flash.display.Sprite; import flash.net.URLLoader; import flash.net.URLRequest; import flash.events.*; public class ErrorEventExample extends Sprite { private var loader:URLLoader; private var request:URLRequest; public function ErrorEventExample() { loader = new URLLoader(); loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler); request = new URLRequest(); loadFromFileSystem(); } private function loadFromFileSystem():void { request.url = "MissingFile.xml"; loader.load(request); } private function loadFromNetwork():void { request.url = "http://www.[yourDomain].com/MissingFile.xml"; loader.load(request); } private function errorHandler(event:ErrorEvent):void { trace("errorHandler: " + event); if(event is IOErrorEvent) { loadFromNetwork(); } } } }
UncaughtErrorEventerrorflash.events:ErrorEvent:ERRORflash.events:ErrorEventErrorEvent Creates an Event object that contains information about error events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of error event: ErrorEvent.ERROR. bubblesBooleanfalseDetermines whether the Event object bubbles. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. textStringText to be displayed as an error message. Event listeners can access this information through the text property. idint0A reference number to associate with the specific error (supported in Adobe AIR only). Constructor for ErrorEvent objects. Creates an Event object that contains information about error events. Event objects are passed as parameters to event listeners. clone Creates a copy of the ErrorEvent object and sets the value of each property to match that of the original.A new ErrorEvent object with property values that match those of the original. flash.events:Event Creates a copy of the ErrorEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the ErrorEvent object.A string that contains all the properties of the ErrorEvent object. String Returns a string that contains all the properties of the ErrorEvent object. The string is in the following format:

[ErrorEvent type=value bubbles=value cancelable=value text=value errorID=value]

Note: The errorId value returned by the toString() method is only available for Adobe AIR. While Flash Player 10.1 supports the errorID property, calling toString() on the ErrorEvent object does not provide the errorId value in Flash Player.

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

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; 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.
errorID Contains the reference number associated with the specific error.int Contains the reference number associated with the specific error. For a custom ErrorEvent object, this number is the value from the id parameter supplied in the constructor.
SoftKeyboardTrigger The SoftKeyboardTrigger class defines the possible values for the triggerType property of the SoftKeyboardEvent class.Defines the possible values for the triggerType property of the SoftKeyboardEvent class. Object The SoftKeyboardTrigger class defines the possible values for the triggerType property of the SoftKeyboardEvent class. These values indicate what type of action triggered a SoftKeyboard activation event. CONTENT_TRIGGERED A function call triggered the event.contentTriggeredStringIndicates that a function call invoked the event. A function call triggered the event. USER_TRIGGERED A user action triggered the event.userTriggeredStringIndicates that a user action invoked the event. A user action triggered the event. Typical user actions that can trigger this event include explicitly closing the keyboard, or pressing the Back key. TransformGestureEvent The TransformGestureEvent class lets you handle complex movement input events (such as moving fingers across a touch screen) that the device or operating system interprets as a gesture.provides event handling support for touch movement interaction flash.events:GestureEvent The TransformGestureEvent class lets you handle complex movement input events (such as moving fingers across a touch screen) that the device or operating system interprets as a gesture. A gesture can have one or more touch points. When a user interacts with a device such as a mobile phone or tablet with a touch screen, the user typically touches and moves across the screen with his or her fingers or a pointing device. You can develop applications that respond to this user interaction with the GestureEvent, PressAndTapGestureEvent, and TransformGestureEvent classes. Create event listeners using the event types defined here, or in the related GestureEvent and TouchEvent classes. And, use the properties and methods of these classes to construct event handlers that respond to the user touching the device.

A device or operating system interprets gesture input. So, different devices or operating systems have different requirements for individual gesture types. A swipe on one device might require different input movement than a swipe on another device. Refer to the hardware or operating system documentation to discover how the device or operating system interprets contact as a specific gesture.

Use the Multitouch class to determine the current environment's support for touch interaction, and to manage the support of touch interaction if the current environment supports it.

Note: When objects are nested on the display list, touch events target the deepest possible nested object that is visible in the display list. This object is called the target node. To have a target node's ancestor (an object containing the target node in the display list) receive notification of a touch event, use EventDispatcher.addEventListener() on the ancestor node with the type parameter set to the specific touch event you want to detect.

While the user is in contact with the device, the TransformGestureEvent object's scale, rotation, and offset properties are incremental values from the previous gesture event. For example, as a gesture increases the size of a display object, the scale values might go in sequence 1.03, 1.01, 1.01, 1.02 indicating the display object scaled 1.0717 times its original size by the end of the gesture.

For TransformGestureEvent objects, properties not modified by the current gesture are set to identity values. For example, a pan gesture does not have a rotation or scale transformation, so the rotation value of the event object is 0, the scaleX and scaleY properties are 1.

The following example shows event handling for the GESTURE_ROTATE events. While the user performs a rotation gesture on the touch-enabled device, mySprite rotates and myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate ); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onRotate(evt:TransformGestureEvent):void { evt.target.rotation -= 45; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } } The following example shows how to handle transform gesture events. This example assumes an image is on your local system called "african_elephant.jpg" and in the same directory as the TransformGestureExample2 class. This example comes from Christian Cantrell, and is explained in more detail in his quickstart: Multi-touch and gesture support on the Flash Platform. package { import flash.display.Bitmap; import flash.display.Sprite; import flash.events.TransformGestureEvent; import flash.text.TextField; import flash.text.TextFormat; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode; [SWF(width=320, height=460, frameRate=24, backgroundColor=0x000000)] public class TransformGestureExample2 extends Sprite { [Embed(source="african_elephant.jpg")] public var ElephantImage:Class; public var scaleDebug:TextField; public var rotateDebug:TextField; public function TransformGestureExample2() { // Debug var tf:TextFormat = new TextFormat(); tf.color = 0xffffff; tf.font = "Helvetica"; tf.size = 11; this.scaleDebug = new TextField(); this.scaleDebug.width = 310; this.scaleDebug.defaultTextFormat = tf; this.scaleDebug.x = 2; this.scaleDebug.y = 2; this.stage.addChild(this.scaleDebug); this.rotateDebug = new TextField(); this.rotateDebug.width = 310; this.rotateDebug.defaultTextFormat = tf; this.rotateDebug.x = 2; this.rotateDebug.y = 15; this.stage.addChild(this.rotateDebug); var elephantBitmap:Bitmap = new ElephantImage(); var elephant:Sprite = new Sprite(); elephant.addChild(elephantBitmap); elephant.x = 160; elephant.y = 230; elephantBitmap.x = (300 - (elephantBitmap.bitmapData.width / 2)) * -1; elephantBitmap.y = (400 - (elephantBitmap.bitmapData.height / 2)) *-1; this.addChild(elephant); Multitouch.inputMode = MultitouchInputMode.GESTURE; elephant.addEventListener(TransformGestureEvent.GESTURE_ZOOM, onZoom); elephant.addEventListener(TransformGestureEvent.GESTURE_ROTATE, onRotate); } private function onZoom(e:TransformGestureEvent):void { this.scaleDebug.text = (e.scaleX + ", " + e.scaleY); var elephant:Sprite = e.target as Sprite; elephant.scaleX *= e.scaleX; elephant.scaleY *= e.scaleY; } private function onRotate(e:TransformGestureEvent):void { var elephant:Sprite = e.target as Sprite; this.rotateDebug.text = String(e.rotation); elephant.rotation += e.rotation; } } }
flash.ui.Multitouchflash.events.TouchEventflash.events.GestureEventflash.events.PressAndTapGestureEventflash.events.MouseEventflash.events.EventDispatcher.addEventListener()gesturePanflash.events:TransformGestureEvent:GESTURE_PANflash.events:TransformGestureEvent The following example shows event handling for the GESTURE_PAN events. While the user performs a pan gesture on the touch-enabled device, myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_PAN , onPan); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onPan(evt:TransformGestureEvent):void { evt.target.localX++; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } } flash.display.InteractiveObject.gesturePanflash.events.GesturePhasegestureRotateflash.events:TransformGestureEvent:GESTURE_ROTATEflash.events:TransformGestureEvent The following example shows event handling for the GESTURE_ROTATE events. While the user performs a rotation gesture on the touch-enabled device, mySprite rotates and myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate ); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onRotate(evt:TransformGestureEvent):void { evt.target.rotation -= 45; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } } flash.display.InteractiveObject.gestureRotateflash.events.GesturePhasegestureSwipeflash.events:TransformGestureEvent:GESTURE_SWIPEflash.events:TransformGestureEvent The following example shows event handling for the GESTURE_SWIPE events. While the user performs a swipe gesture on the touch-enabled device, myTextField populates with the phase all, which is the only phase for swipe events. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onSwipe(evt:TransformGestureEvent):void { if (evt.offsetX == 1 ) { myTextField.text = "right"; } if (evt.offsetY == -1) { myTextField.text = "up"; } myTextField.text = evt.phase; } flash.display.InteractiveObject.gestureSwipeflash.events.GesturePhasegestureZoomflash.events:TransformGestureEvent:GESTURE_ZOOMflash.events:TransformGestureEvent The following example shows event handling for the GESTURE_ZOOM events. While the user performs a zoom gesture on the touch-enabled device, myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_ZOOM , onZoom); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onZoom(evt:TransformGestureEvent):void { evt.target.scaleX++; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } } flash.display.InteractiveObject.gestureZoomflash.events.GesturePhaseTransformGestureEvent Creates an Event object that contains information about complex multi-touch events, such as a user sliding his or her finger across a screen.typeString The type of the event. Possible values are: TransformGestureEvent.GESTURE_PAN, TransformGestureEvent.GESTURE_ROTATE, TransformGestureEvent.GESTURE_SWIPE and TransformGestureEvent.GESTURE_ZOOM. bubblesBooleantrue Determines whether the Event object participates in the bubbling phase of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. phaseStringnullThis values tracks the beginning, progress, and end of a touch gesture. Possible values are: GesturePhase.BEGIN, GesturePhase.END, and GesturePhase.UPDATE. localXNumber0The horizontal coordinate at which the event occurred relative to the containing display object. localYNumber0The vertical coordinate at which the event occurred relative to the containing display object. scaleXNumber1.0The horizontal scale of the display object. scaleYNumber1.0The vertical scale of the display object. rotationNumber0The current rotation angle, in degrees, of the display object along the z-axis. offsetXNumber0The horizontal translation of the display object from its original position. offsetYNumber0The vertical translation of the display object from its original position. ctrlKeyBooleanfalseOn Windows or Linux, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. altKeyBooleanfalseIndicates whether the Alt key is activated (Windows or Linux only). shiftKeyBooleanfalseIndicates whether the Shift key is activated. commandKeyBooleanfalse(AIR only) Indicates whether the Command key is activated (Mac only). This parameter is for Adobe AIR only; do not set it for Flash Player content. controlKeyBooleanfalse(AIR only) Indicates whether the Control or Ctrl key is activated. This parameter is for Adobe AIR only; do not set it for Flash Player content. Constructor for TransformGestureEvent objects. Creates an Event object that contains information about complex multi-touch events, such as a user sliding his or her finger across a screen. Event objects are passed as parameters to event listeners. flash.ui.Multitouchflash.events.TouchEventflash.events.GestureEventflash.events.PressAndTapGestureEventflash.events.GesturePhaseflash.events.MouseEventflash.events.EventDispatcher.addEventListener()clone Creates a copy of the TransformGestureEvent object and sets the value of each property to match that of the original.A new TransformGestureEvent object with property values that match those of the original. flash.events:Event Creates a copy of the TransformGestureEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the TransformGestureEvent object.A string that contains all the properties of the TransformGestureEvent object. String Returns a string that contains all the properties of the TransformGestureEvent object. The string is in the following format:

[TransformGestureEvent type=value bubbles=value cancelable=value ... ]

GESTURE_PAN Defines the value of the type property of a GESTURE_PAN touch event object.gesturePanString Defines the value of the type property of a GESTURE_PAN touch event object.

The dispatched TransformGestureEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.phaseThe current phase in the event flow; a value from the GesturePhase class.localXThe horizontal coordinate at which the event occurred relative to the containing display object.localYThe vertical coordinate at which the event occurred relative to the containing display object.scaleXThe horizontal scale of the display object since the previous gesture event. For pan gestures this value is 1.scaleYThe vertical scale of the display object since the previous gesture event. For pan gestures this value is 1.rotationThe current rotation angle, in degrees, of the display object along the z-axis, since the previous gesture event. For pan gestures this value is 0.offsetXThe horizontal translation of the display object from its position at the previous gesture event.offsetYThe vertical translation of the display object from its position at the previous gesture event.shiftKeytrue if the Shift key is active; false if it is inactive.targetThe InteractiveObject instance under the touching device. 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.
The following example shows event handling for the GESTURE_PAN events. While the user performs a pan gesture on the touch-enabled device, myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_PAN , onPan); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onPan(evt:TransformGestureEvent):void { evt.target.localX++; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } }
flash.display.InteractiveObject.gesturePanflash.events.GesturePhase
GESTURE_ROTATE Defines the value of the type property of a GESTURE_ROTATE touch event object.gestureRotateString Defines the value of the type property of a GESTURE_ROTATE touch event object.

The dispatched TransformGestureEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.phaseThe current phase in the event flow; a value from the GesturePhase class.localXThe horizontal coordinate at which the event occurred relative to the containing display object.localYThe vertical coordinate at which the event occurred relative to the containing display object.scaleXThe horizontal scale of the display object since the previous gesture event.scaleYThe vertical scale of the display object since the previous gesture event.rotationThe current rotation angle, in degrees, of the display object along the z-axis, since the previous gesture event.offsetXThe horizontal translation of the display object from its position at the previous gesture event.offsetYThe vertical translation of the display object from its position at the previous gesture event.shiftKeytrue if the Shift key is active; false if it is inactive.targetThe InteractiveObject instance under the touching device. 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.
The following example shows event handling for the GESTURE_ROTATE events. While the user performs a rotation gesture on the touch-enabled device, mySprite rotates and myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate ); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onRotate(evt:TransformGestureEvent):void { evt.target.rotation -= 45; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } }
flash.display.InteractiveObject.gestureRotateflash.events.GesturePhase
GESTURE_SWIPE Defines the value of the type property of a GESTURE_SWIPE touch event object.gestureSwipeString Defines the value of the type property of a GESTURE_SWIPE touch event object.

The dispatched TransformGestureEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.phaseThe current phase in the event flow. For swipe events, this value is always all corresponding to the value GesturePhase.ALL once the event is dispatched.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.scaleXThe horizontal scale of the display object. For swipe gestures this value is 1scaleYThe vertical scale of the display object. For swipe gestures this value is 1rotationThe current rotation angle, in degrees, of the display object along the z-axis. For swipe gestures this value is 0offsetXIndicates horizontal direction: 1 for right and -1 for left.offsetYIndicates vertical direction: 1 for down and -1 for up.shiftKeytrue if the Shift key is active; false if it is inactive.targetThe InteractiveObject instance under the touching device. 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.
The following example shows event handling for the GESTURE_SWIPE events. While the user performs a swipe gesture on the touch-enabled device, myTextField populates with the phase all, which is the only phase for swipe events. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onSwipe(evt:TransformGestureEvent):void { if (evt.offsetX == 1 ) { myTextField.text = "right"; } if (evt.offsetY == -1) { myTextField.text = "up"; } myTextField.text = evt.phase; }
flash.display.InteractiveObject.gestureSwipeflash.events.GesturePhase
GESTURE_ZOOM Defines the value of the type property of a GESTURE_ZOOM touch event object.gestureZoomString Defines the value of the type property of a GESTURE_ZOOM touch event object.

The dispatched TransformGestureEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.phaseThe current phase in the event flow; a value from the GesturePhase class.localXThe horizontal coordinate at which the event occurred relative to the containing display object.localYThe vertical coordinate at which the event occurred relative to the containing display object.scaleXThe horizontal scale of the display object since the previous gesture event.scaleYThe vertical scale of the display object since the previous gesture event.rotationThe current rotation angle, in degrees, of the display object along the z-axis, since the previous gesture event.offsetXThe horizontal translation of the display object from its position at the previous gesture event.offsetYThe vertical translation of the display object from its position at the previous gesture event.shiftKeytrue if the Shift key is active; false if it is inactive.targetThe InteractiveObject instance under the touching device. 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.
The following example shows event handling for the GESTURE_ZOOM events. While the user performs a zoom gesture on the touch-enabled device, myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_ZOOM , onZoom); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onZoom(evt:TransformGestureEvent):void { evt.target.scaleX++; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } }
flash.display.InteractiveObject.gestureZoomflash.events.GesturePhase
offsetX The horizontal translation of the display object, since the previous gesture event.Number The horizontal translation of the display object, since the previous gesture event. offsetY The vertical translation of the display object, since the previous gesture event.Number The vertical translation of the display object, since the previous gesture event. rotation The current rotation angle, in degrees, of the display object along the z-axis, since the previous gesture event.Number The current rotation angle, in degrees, of the display object along the z-axis, since the previous gesture event. scaleX The horizontal scale of the display object, since the previous gesture event.Number The horizontal scale of the display object, since the previous gesture event. scaleY The vertical scale of the display object, since the previous gesture event.Number The vertical scale of the display object, since the previous gesture event.
NativeDragEvent Native drag events are dispatched by the interactive objects involved in a drag-and-drop operation.flash.events:MouseEvent Native drag events are dispatched by the interactive objects involved in a drag-and-drop operation.

The initiating object dispatches:

  • nativeDragStart — When the drag operation begins.
  • nativeDragUpdate — While the drag operation is in progress.
  • nativeDragComplete — When the user releases the dragged item (whether or not the drop was accepted).

The initiating object is the interactive object passed that is to the NativeDragManager object in the call to NativeDragManager.doDrag() which began the drag operation.

Potential target interactive objects dispatches:

  • nativeDragEnter — When the drag gesture passes within the object boundary.
  • nativeDragOver — While the drag gesture remains within the object boundary.
  • nativeDragExit — When the drag gesture leaves the object boundary.
  • nativeDragDrop — When the user releases the dragged item over the object and the object has accepted the drop with an earlier call to NativeDragManager.acceptDragDrop().

Typically a handler for the nativeDragEnter or nativeDragOver event evaluates the data being dragged, along with the drag actions allowed, to determine whether an interactive object can accept a drop. To specify that an interactive object is an eligible target, the event handler must call the NativeDragManager.acceptDrop()function, passing in a reference to the object. If the user releases the mouse button over the designated object, the object becomes the drop target and dispatches the nativeDragDrop event.

Any InteractiveObject type object can be a drag initiator or a drop target.

flash.desktop.NativeDragManagerflash.desktop.Clipboardflash.desktop.NativeDragOptionsflash.desktop.NativeDragActionsflash.display.InteractiveObjectnativeDragCompleteflash.events:NativeDragEvent:NATIVE_DRAG_COMPLETEflash.events:NativeDragEventDispatched by the source InteractiveObject when a drag-and-drop gesture ends. flash.display.InteractiveObject.nativeDragCompleteflash.desktop.NativeDragActionsnativeDragDropflash.events:NativeDragEvent:NATIVE_DRAG_DROPflash.events:NativeDragEventDispatched by InteractiveObjects when a drag-and-drop gesture ends over the object. flash.display.InteractiveObject.nativeDragDropnativeDragEnterflash.events:NativeDragEvent:NATIVE_DRAG_ENTERflash.events:NativeDragEventDispatched by InteractiveObjects when a drag-and-drop gesture enters the object bounds. flash.display.InteractiveObject.nativeDragEnternativeDragExitflash.events:NativeDragEvent:NATIVE_DRAG_EXITflash.events:NativeDragEventDispatched by InteractiveObjects when a drag-and-drop gesture leaves the object bounds. flash.display.InteractiveObject.nativeDragExitnativeDragOverflash.events:NativeDragEvent:NATIVE_DRAG_OVERflash.events:NativeDragEventDispatched by InteractiveObjects while a drag-and-drop gesture hovers over the object. flash.display.InteractiveObject.nativeDragOvernativeDragStartflash.events:NativeDragEvent:NATIVE_DRAG_STARTflash.events:NativeDragEventDispatched by the source InteractiveObject at the begining of a native drag-and-drop gesture. flash.display.InteractiveObject.nativeDragStartnativeDragUpdateflash.events:NativeDragEvent:NATIVE_DRAG_UPDATEflash.events:NativeDragEventDispatched by the source InteractiveObject while a drag-and-drop gesture is underway. flash.display.InteractiveObject.nativeDragUpdateNativeDragEvent Creates an Event object with specific information relevant to native drag-and-drop events.typeString The type of the event. Possible values are: NativeDragEvent.NATIVE_DRAG_START, NativeDragEvent.NATIVE_DRAG_UPDATE, NativeDragEvent.NATIVE_DRAG_ENTER, NativeDragEvent.NATIVE_DRAG_OVER, NativeDragEvent.NATIVE_DRAG_EXIT, NativeDragEvent.NATIVE_DRAG_DROP, and NativeDragEvent.NATIVE_DRAG_COMPLETE. bubblesBooleanfalseIndicates whether the Event object participates in the bubbling phase of the event flow. cancelableBooleantrueIndicates whether the Event object can be canceled. localXNumberunknownThe horizontal coordinate at which the event occurred relative to the containing sprite. localYNumberunknownThe vertical coordinate at which the event occurred relative to the containing sprite. relatedObjectflash.display:InteractiveObjectnullThe related interactive display object. clipboardflash.desktop:ClipboardnullThe Clipboard object containing the data to be transfered. allowedActionsflash.desktop:NativeDragOptionsnullThe NativeDragOptions object defining the allowed actions (move, copy, and link). dropActionStringnullThe current action. controlKeyBooleanfalseIndicates whether the Control key is activated. altKeyBooleanfalseIndicates whether the Alt key is activated. shiftKeyBooleanfalseIndicates whether the Shift key is activated. commandKeyBooleanfalseIndicates whether the Command key is activated. Creates an Event object with specific information relevant to native drag-and-drop events.

Event objects are passed as parameters to event listeners. Dispatching a native drag event does not trigger the associated behavior.

clone Creates a copy of this NativeDragEvent object.A new NativeDragEvent object with property values that match those of the original. flash.events:Event Creates a copy of this NativeDragEvent object. toString Formats the properties of this NativeDragEvent object as a string.The properties of this NativeDragEvent as a string. String Formats the properties of this NativeDragEvent object as a string.

The string is in the following format:

[NativeDragEvent type=value bubbles=value cancelable=value ... commandKey=value]

NATIVE_DRAG_COMPLETE NativeDragEvent.NATIVE_DRAG_COMPLETE defines the value of the type property of a nativeDragComplete event object.nativeDragCompleteStringDispatched by the source InteractiveObject when a drag-and-drop gesture ends. NativeDragEvent.NATIVE_DRAG_COMPLETE defines the value of the type property of a nativeDragComplete event object.

This event has the following properties:

PropertyValueallowedActionsThe NativeDragOptions object specifying the actions relevant to this drag operation.bubblestruecancelablefalse; there is no default behavior to cancel.clipboardThe Clipboard object containing the dragged data.dropActionThe action chosen by the drop target (or none if no action was set).
flash.display.InteractiveObject.nativeDragCompleteflash.desktop.NativeDragActions
NATIVE_DRAG_DROP NativeDragEvent.NATIVE_DRAG_DROP defines the value of the type property of a nativeDragDrop event object.nativeDragDropStringDispatched by InteractiveObjects when a drag-and-drop gesture ends over the object. NativeDragEvent.NATIVE_DRAG_DROP defines the value of the type property of a nativeDragDrop event object.

This event has the following properties:

PropertyValueallowedActionsThe NativeDragOptions object specifying the actions relevant to this drag operation.bubblestruecancelabletrue; canceling this event cancels the drag operation.clipboardThe Clipboard object containing the dragged data. The clipboard can be read even if the object dispatching this event is not in the same security domain as the initiator.dropActionThe action chosen by the drop target (or none if no action was set).
flash.display.InteractiveObject.nativeDragDrop
NATIVE_DRAG_ENTER NativeDragEvent.NATIVE_DRAG_ENTER defines the value of the type property of a nativeDragEnter event object.nativeDragEnterStringDispatched by InteractiveObjects when a drag-and-drop gesture enters the object bounds. NativeDragEvent.NATIVE_DRAG_ENTER defines the value of the type property of a nativeDragEnter event object.

This event has the following properties:

PropertyValueallowedActionsThe NativeDragOptions object specifying the actions relevant to this drag operation.bubblestruecancelablefalse; there is no default behavior to cancel.clipboardThe Clipboard object containing the dragged data. The clipboard can be read only if the object dispatching this event is in the same security domain as the initiator.dropActionThe action chosen by the drop target (or none if no action was set).
flash.display.InteractiveObject.nativeDragEnter
NATIVE_DRAG_EXIT NativeDragEvent.NATIVE_DRAG_EXIT defines the value of the type property of a nativeDragExit event object.nativeDragExitStringDispatched by InteractiveObjects when a drag-and-drop gesture leaves the object bounds. NativeDragEvent.NATIVE_DRAG_EXIT defines the value of the type property of a nativeDragExit event object.

This event has the following properties:

PropertyValueallowedActionsThe NativeDragOptions object specifying the actions relevant to this drag operation.bubblestruecancelablefalse; there is no default behavior to cancel.clipboardThe Clipboard object containing the dragged data. The clipboard can be read only if the object dispatching this event is in the same security domain as the initiator.dropActionThe action chosen by the drop target (or none if no action was set).
flash.display.InteractiveObject.nativeDragExit
NATIVE_DRAG_OVER NativeDragEvent.NATIVE_DRAG_OVER defines the value of the type property of a nativeDragOver event object.nativeDragOverStringDispatched by InteractiveObjects while a drag-and-drop gesture hovers over the object. NativeDragEvent.NATIVE_DRAG_OVER defines the value of the type property of a nativeDragOver event object.

This event has the following properties:

PropertyValueallowedActionsThe NativeDragOptions object specifying the actions relevant to this drag operation.bubblestruecancelabletrue; canceling this event cancels the drag operation.clipboardThe Clipboard object containing the dragged data. The clipboard can be read only if the object dispatching this event is in the same security domain as the initiator.dropActionThe action chosen by the drop target (or none if no action was set).
flash.display.InteractiveObject.nativeDragOver
NATIVE_DRAG_START NativeDragEvent.NATIVE_DRAG_START defines the value of the type property of a nativeDragStart event object.nativeDragStartStringDispatched by the source InteractiveObject at the begining of a native drag-and-drop gesture. NativeDragEvent.NATIVE_DRAG_START defines the value of the type property of a nativeDragStart event object.

This event has the following properties:

PropertyValueallowedActionsThe NativeDragOptions object specifying the actions relevant to this drag operation.bubblestruecancelabletrue; canceling this event cancels the drag operation.clipboardThe Clipboard object containing the dragged data.dropActionThe action chosen by the drop target (or none if no action was set).
flash.display.InteractiveObject.nativeDragStart
NATIVE_DRAG_UPDATE NativeDragEvent.NATIVE_DRAG_UPDATE defines the value of the type property of a nativeDragUpdate event object.nativeDragUpdateStringDispatched by the source InteractiveObject while a drag-and-drop gesture is underway. NativeDragEvent.NATIVE_DRAG_UPDATE defines the value of the type property of a nativeDragUpdate event object.

This event has the following properties:

PropertyValueallowedActionsThe NativeDragOptions object specifying the actions relevant to this drag operation.bubblestruecancelablefalse; there is no default behavior to cancel.clipboardThe Clipboard object containing the dragged data.dropActionThe action chosen by the drop target (or none if no action was set).
flash.display.InteractiveObject.nativeDragUpdate
allowedActions The NativeDragOptions object specifying the actions that are allowed by the display object that initiated this drag operation.flash.desktop:NativeDragOptions The NativeDragOptions object specifying the actions that are allowed by the display object that initiated this drag operation. flash.desktop.NativeDragOptionsclipboard The Clipboard object containing the data in this drag operation.flash.desktop:Clipboard The Clipboard object containing the data in this drag operation.

If the object dispatching the event is not in the same security domain as the initiating object, then the clipboard can be read only in the handler for a nativeDragDrop event.

flash.desktop.Clipboard
dropAction The current action.String The current action. In the nativeDragComplete event, the dropAction property reports the final action.
PressAndTapGestureEvent The PressAndTapGestureEvent class lets you handle press-and-tap gesture on touch-enabled devices.provides event handling support for press and tap gesture flash.events:GestureEvent The PressAndTapGestureEvent class lets you handle press-and-tap gesture on touch-enabled devices. Objects that inherit properties from the InteractiveObject class capture the primary touch point (press) and a secondary point (tap) in the dispatched event object. The press-and-tap gesture is typically used to raise a context-sensitive popup menu. The following example shows event handling for the GESTURE_PRESS_AND_TAP event. While the user performs a press-and-tap gesture, mySprite rotates and myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(PressAndTapGestureEvent.GESTURE_PRESS_AND_TAP , onPressAndTap ); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onPressAndTap(evt:PressAndTapGestureEvent):void { evt.target.rotation -= 45; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } } flash.ui.Multitouchflash.display.InteractiveObjectflash.events.TouchEventflash.events.GestureEventflash.events.MouseEventflash.events.EventDispatcher.addEventListener()gesturePressAndTapflash.events:PressAndTapGestureEvent:GESTURE_PRESS_AND_TAPflash.events:PressAndTapGestureEventflash.display.InteractiveObject.gesturePressAndTapflash.events.GesturePhasePressAndTapGestureEvent Creates an Event object that contains information about complex multi-touch events, such as a user raising a context-sensitive popup menu.typeString The type of the event: PressAndTapGestureEvent.GESTURE_PRESS_AND_TAP. bubblesBooleantrue Determines whether the Event object participates in the bubbling phase of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. phaseStringnullThis values tracks the beginning, progress, and end of a touch gesture. Possible values are: GesturePhase.BEGIN, GesturePhase.END, GesturePhase.UPDATE, or GesturePhase.ALL. localXNumber0The horizontal coordinate at which the event occurred relative to the containing display object. localYNumber0The vertical coordinate at which the event occurred relative to the containing display object. tapLocalXNumber0The horizontal coordinate at which the event occurred relative to the containing interactive object. tapLocalYNumber0The vertical coordinate at which the event occurred relative to the containing interactive object. ctrlKeyBooleanfalseOn Windows or Linux, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. altKeyBooleanfalseIndicates whether the Alt key is activated (Windows or Linux only). shiftKeyBooleanfalseIndicates whether the Shift key is activated. commandKeyBooleanfalse(AIR only) Indicates whether the Command key is activated (Mac only). This parameter is for Adobe AIR only; do not set it for Flash Player content. controlKeyBooleanfalse(AIR only) Indicates whether the Control or Ctrl key is activated. This parameter is for Adobe AIR only; do not set it for Flash Player content. Constructor for PressAndTapGestureEvent objects. Creates an Event object that contains information about complex multi-touch events, such as a user raising a context-sensitive popup menu. Event objects are passed as parameters to event listeners. flash.ui.Multitouchflash.events.TouchEventflash.events.GestureEventflash.events.GesturePhaseflash.events.MouseEventflash.events.EventDispatcher.addEventListener()clone Creates a copy of the PressAndTapGestureEvent object and sets the value of each property to match that of the original.A new PressAndTapGestureEvent object with property values that match those of the original. flash.events:Event Creates a copy of the PressAndTapGestureEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the PressAndTapGestureEvent object.A string that contains all the properties of the PressAndTapGestureEvent object. String Returns a string that contains all the properties of the PressAndTapGestureEvent object. The string is in the following format:

[PressAndTapGestureEvent type=value bubbles=value cancelable=value ... ]

GESTURE_PRESS_AND_TAP Defines the value of the type property of a GESTURE_PRESS_AND_TAP touch event object.gesturePressAndTapString Defines the value of the type property of a GESTURE_PRESS_AND_TAP touch event object.

The dispatched PressAndTapGestureEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase as the event passes through the object hierarchy; a numeric value indicating the event is captured (1), at the target (2), or bubbling (3).localXThe horizontal coordinate at which the event occurred relative to the containing display object.localYThe vertical coordinate at which the event occurred relative to the containing display object.phaseThe current phase in the event flow; a value from the GesturePhase class.Possible values are: GesturePhase.BEGIN, GesturePhase.UPDATE, GesturePhase.END, or GesturePhase.ALL. A press-and-tap gesture either generates a GesturePhase.BEGIN, GesturePhase.UPDATE, GesturePhase.END sequence or the gesture generates a single GesturePhase.ALL phase.shiftKeytrue if the Shift key is active; false if it is inactive.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.tapLocalXThe horizontal coordinate at which the event occurred relative to the containing interactive object.tapLocalYThe vertical coordinate at which the event occurred relative to the containing interactive object.tapStageXThe horizontal coordinate at which the tap touch occurred in global Stage coordinates.tapStageYThe vertical coordinate at which the tap touch occurred in global Stage coordinates.targetThe InteractiveObject instance under the touching device. 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.
flash.display.InteractiveObject.gesturePressAndTapflash.events.GesturePhase
tapLocalX The horizontal coordinate at which the event occurred relative to the containing interactive object.Number The horizontal coordinate at which the event occurred relative to the containing interactive object. tapLocalY The vertical coordinate at which the event occurred relative to the containing interactive object.Number The vertical coordinate at which the event occurred relative to the containing interactive object. tapStageX The horizontal coordinate at which the tap touch occurred in global Stage coordinates.Number The horizontal coordinate at which the tap touch occurred in global Stage coordinates. This property is calculated when the tapLocalX property is set. tapStageY The vertical coordinate at which the tap touch occurred in global Stage coordinates.Number The vertical coordinate at which the tap touch occurred in global Stage coordinates. This property is calculated when the tapLocalX property is set.
GeolocationEvent A Geolocation object dispatches GeolocationEvent objects when it receives updates from the location sensor installed on the device.flash.events:Event A Geolocation object dispatches GeolocationEvent objects when it receives updates from the location sensor installed on the device. updateflash.events:GeolocationEvent:UPDATEflash.events:GeolocationEventGeolocationEvent Creates a GeolocationEvent object that contains information about the location of the device.typeString Specifies the type of the event. Event listeners can access this information through the inherited type property. There is only one type of update event: GeolocationEvent.UPDATE. bubblesBooleanfalseIndicates whether the event is a bubbling event. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the event object can be canceled. Event listeners can access this information through the inherited cancelable property. latitudeNumber0Returns the latitude in degrees. The values have the following range: (-90 <= Lat <= +90). longitudeNumber0Returns the longitude in degrees. The values have the following range: (-180 <= Long < +180). altitudeNumber0Returns the altitude in meters. hAccuracyNumber0Returns the horizontal accuracy in meters. vAccuracyNumber0Returns the vertical accuracy in meters. speedNumber0 Returns the speed in meters/second. headingNumber0Returns the direction of movement (with respect to True North) in integer degrees. timestampNumber0Specifies the timestamp of the geolocation update. Constructor for GeolocationEvent objects. Creates a GeolocationEvent object that contains information about the location of the device. Event objects are passed as parameters to event listeners. clone Creates a copy of the GeolocationEvent object and sets the value of each property to match that of the original.A new GeolocationEvent object with property values that match those of the original. flash.events:Event Creates a copy of the GeolocationEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the GeolocationEvent object.A string that contains all the properties of the GeolocationEvent object. String Returns a string that contains all the properties of the GeolocationEvent object. The string is in the following format:

[GeolocationEvent type=value bubbles=value cancelable=value status=value]

UPDATE Defines the value of the type property of a GeolocationEvent event object.updateString Defines the value of the type property of a GeolocationEvent event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe Geolocation object receiving data.
altitude The altitude in meters.Number The altitude in meters.

If altitude is not supported by the device, then this property is set to NaN.

heading The direction of movement (with respect to true north) in integer degrees.Number The direction of movement (with respect to true north) in integer degrees. This is not the same as "bearing", which returns the direction of movement with respect to another point.

Note: On Android devices, heading is not supported. The value of the heading property is always NaN (Not a Number).

horizontalAccuracy The horizontal accuracy in meters.Number The horizontal accuracy in meters. latitude The latitude in degrees.Number The latitude in degrees. The latitude values have the following range: (-90 <= latitude <= 90). Negative latitude is south and positive latitude is north. longitude The longitude in degrees.Number The longitude in degrees. The longitude values have the following range: (-180 <= longitude < 180). Negative longitude is west and positive longitude is east. speed The speed in meters/second.Number The speed in meters/second. timestamp The number of milliseconds at the time of the event since the runtime was initialized.Number The number of milliseconds at the time of the event since the runtime was initialized. For example, if the device captures geolocation data 4 seconds after the application initializes, then the timestamp property of the event is set to 4000. verticalAccuracy The vertical accuracy in meters.Number The vertical accuracy in meters.
MediaEvent CameraRoll and CameraUI classes dispatch MediaEvent objects when a media stream is available.flash.events:Event CameraRoll and CameraUI classes dispatch MediaEvent objects when a media stream is available.

The CameraRoll class dispatches a select-type MediaEvent object when the user selects an image. The CameraUI class dispatches a complete-type MediaEvent object when an image or video captured from the device camera is returned.

CameraRollCameraUIcompleteflash.events:MediaEvent:COMPLETEflash.events:MediaEventThe complete event type. selectflash.events:MediaEvent:SELECTflash.events:MediaEventThe select event type. MediaEvent Creates an MediaEvent object that contains information about the available media file.typeStringThe type of the event. bubblesBooleanfalseDetermines whether the Event object bubbles. cancelableBooleanfalseDetermines whether the Event object can be canceled. dataflash.media:MediaPromisenullThe MediaPromise object corresponding to the selected image. Constructor for MediaEvent objects. Creates an MediaEvent object that contains information about the available media file. Event objects are passed as parameters to event listeners. clone Creates a copy of an MediaEvent object and sets the value of each property to match that of the original.a new MediaEvent object with property values that match those of the original. flash.events:Event Creates a copy of an MediaEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of MediaEvent object.a new MediaEvent object with property values that match those of the original. String Returns a string that contains all the properties of MediaEvent object. The following format is used:

[MediaEvent type=value bubbles=value cancelable=value data=value ]

COMPLETE A constant for the complete MediaEvent.completeStringThe complete event type. A constant for the complete MediaEvent.

Defines the value of the type property of a MediaEvent event object. This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.dataThe MediaPromise object of the available media instance.
SELECT A constant for the select MediaEvent.selectStringThe select event type. A constant for the select MediaEvent.

Defines the value of the type property of a MediaEvent event object. This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.dataThe MediaPromise object of the available media instance.
data The MediaPromise object for the available media file.flash.media:MediaPromise The MediaPromise object for the available media file.
StageVideoEvent A StageVideo object dispatches a StageVideoEvent object after the attachNetStream() method of the StageVideo object and the play() method of the attached NetStream object have both been called.Event objects for StageVideo events. flash.events:Event A StageVideo object dispatches a StageVideoEvent object after the attachNetStream() method of the StageVideo object and the play() method of the attached NetStream object have both been called. Also, depending on the platform, any change in the playing status can result in dispatching the event. The one type of StageVideoEvent is StageVideoEvent.RENDER_STATE. renderStateflash.events:StageVideoEvent:RENDER_STATEflash.events:StageVideoEventflash.events.StageVideoEvent.RENDER_STATEflash.events.StageVideoEvent.RENDER_STATUS_UNAVAILABLEflash.events.StageVideoEvent.RENDER_STATUS_SOFTWAREflash.events.StageVideoEvent.RENDER_STATUS_ACCELERATEDStageVideoEvent Creates an Event object that contains information about StageVideo events.typeString The type of the event. Event listeners can access this information through the inherited type property. The one type of StageVideoEvent is StageVideoEvent.RENDER_STATE. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. statusStringnullIndicates the status of the target StageVideo object. colorSpaceStringnullThe color space used by the video being displayed. Constructor for StageVideoEvent objects. Creates an Event object that contains information about StageVideo events. Event objects are passed as parameters to event listeners. flash.media.StageVideoflash.display.Stage.stageVideosflash.events.StageVideoEvent.RENDER_STATERENDER_STATE The StageVideoEvent.RENDER_STATE constant defines the value of the type property of a renderState event object.renderStateString The StageVideoEvent.RENDER_STATE constant defines the value of the type property of a renderState event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.colorSpaceThe available color spaces for displaying the video.currentTargetThe object that is actively processing the StageVideoEvent object with an event listener.statusIndicates whether the video is being rendered (decoded and displayed) by hardware or software, or not at all.targetThe StageVideo object that changed state.
flash.events.StageVideoEvent.RENDER_STATEflash.events.StageVideoEvent.RENDER_STATUS_UNAVAILABLEflash.events.StageVideoEvent.RENDER_STATUS_SOFTWAREflash.events.StageVideoEvent.RENDER_STATUS_ACCELERATED
RENDER_STATUS_ACCELERATED Indicates that hardware is decoding and displaying the video.acceleratedString Indicates that hardware is decoding and displaying the video.

This value is one of the possible values of the StageVideoEvent object status property.

status
RENDER_STATUS_SOFTWARE Indicates that software is decoding and displaying the video.softwareString Indicates that software is decoding and displaying the video.

This value is one of the possible values of the StageVideoEvent object status property.

For example, if the platform does not support hardware decoding and display of the audio or video codec of the video, the StageVideoEvent object has this status value.

status
RENDER_STATUS_UNAVAILABLE Indicates that displaying the video using the StageVideo object is not possible.unavailableString Indicates that displaying the video using the StageVideo object is not possible.

This value is one of the possible values of the StageVideoEvent object status property.

For example, consider a platform that does not support decoding and displaying the video's audio or video codec with either software or hardware. In this case, the StageVideoEvent object has this status value.

This status value also is used if no hardware decoders are available. This situation can occur in AIR for TV. For backward compatibility with its previous releases, AIR for TV allows you to use a Video object for hardware decoding and display. By using a Video object, you are using the underlying hardware decoder and therefore you have one less StageVideo object available for use. Note that using a StageVideo object for hardware video decoding and display is recommended.

status
colorSpace The color space used by the video being displayed in the StageVideo object.String The color space used by the video being displayed in the StageVideo object. flash.media.StageVideostatus The status of the StageVideo object.String The status of the StageVideo object. flash.events.StageVideoEvent.RENDER_STATUS_UNAVAILABLEflash.events.StageVideoEvent.RENDER_STATUS_SOFTWAREflash.events.StageVideoEvent.RENDER_STATUS_ACCELERATED
LocationChangeEvent An HTMLLoader or StageWebView object dispatches a LocationChangeEvent object when a new page loads.flash.events:Event An HTMLLoader or StageWebView object dispatches a LocationChangeEvent object when a new page loads.

There are two types of LocationChangeEvent:

  • LocationChangeEvent.LOCATION_CHANGING: dispatched before a change initiated via the content displayed in a StageWebView object. Can be canceled.
  • LocationChangeEvent.LOCATION_CHANGE: dispatched after every location change. Cannot be canceled.
StageWebViewLocationChangeEvent Creates a LocationChangeEvent object.typeStringbubblesBooleanfalsecancelableBooleanfalselocationStringnull Creates a LocationChangeEvent object. clone flash.events:Event toString Returns a string that contains all the properties of the LocationChangeEvent object.String Returns a string that contains all the properties of the LocationChangeEvent object. The string is in the following format:

[LocationChangeEvent type=value bubbles=value cancelable=value eventPhase=value location=value

LOCATION_CHANGE Dispatched after every location change.locationChangeString Dispatched after every location change. LOCATION_CHANGING The LOCATION_CHANGING constant defines the value of the type property LocationChangeEvent object dispatched before a change in page location.locationChangingString The LOCATION_CHANGING constant defines the value of the type property LocationChangeEvent object dispatched before a change in page location. location The destination URL of the change.String The destination URL of the change.
NetDataEvent A NetStream object dispatches a NetDataEvent object when a data message is encountered in the media stream.flash.events:Event A NetStream object dispatches a NetDataEvent object when a data message is encountered in the media stream.

A NetDataEvent is dispatched for the following messages:

  • onCuePoint
  • onImageData
  • onMetaData
  • onPlayStatus (for code NetStream.Play.Complete)
  • onTextData
  • onXMPData
NetDataEvent Creates an event object that contains information about media data events.typeString The type of the event. Event listeners can access this information through the inherited type property. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. timestampNumber0timestamp of the data message infoObjectnulldata message object Creates an event object that contains information about media data events. Event objects are passed as parameters to Event listeners. clone Creates a copy of an NetDataEvent object and sets the value of each property to match that of the original.A new NetDataEvent object with property values that match those of the original. flash.events:Event Creates a copy of an NetDataEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the NetDataEvent object.A string that contains all the properties of the NetMediaEvent object. String Returns a string that contains all the properties of the NetDataEvent object. The following format is used:

[NetDataEvent type=value bubbles=value cancelable=value timestamp=value]

MEDIA_TYPE_DATA The NetDataEvent.MEDIA_TYPE_DATA constant defines the value of the type property of the NetDataEvent object dispatched when a data message in the media stream is encountered by the NetStream object.mediaTypeDataString The NetDataEvent.MEDIA_TYPE_DATA constant defines the value of the type property of the NetDataEvent object dispatched when a data message in the media stream is encountered by the NetStream object. info A data object describing the message.Object A data object describing the message. The info object has two properties: info.handler and info.args. info.handler is the handler name, such as "onMetaData" or "onXMPData". info.args is an array of arguments. timestamp The timestamp of the data message in the media stream.Number The timestamp of the data message in the media stream.
NativeProcessExitEvent This event is dispatched by the NativeProcess object when the process exits.flash.events:Event This event is dispatched by the NativeProcess object when the process exits. It is possible that this event will never be dispatched. For example, if the child process outlives the AIR application that created it, the event will not dispatch. flash.desktop.NativeProcessexitflash.events:NativeProcessExitEvent:EXITflash.events:NativeProcessExitEventNativeProcessExitEvent Creates a NativeProcessExitEvent which contains specific information regarding a NativeProcess's exit code typeString The type of the event, accessible as Event.type. bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. cancelableBooleanfalseDetermines whether the Event object can be canceled. The default values is false. exitCodeNumberunknownNumber that the process returned to the operating system during exit. Creates a NativeProcessExitEvent which contains specific information regarding a NativeProcess's exit code clone Creates a copy of the NativeProcessExitEvent object and sets each property's value to match that of the original.A new NativeProcessExitEvent object with property values that match those of the original. flash.events:Event Creates a copy of the NativeProcessExitEvent object and sets each property's value to match that of the original. toString Returns a string that contains all the properties of the NativeProcessExitEvent object.A string that contains all the properties of the ProgressEvent object. String Returns a string that contains all the properties of the NativeProcessExitEvent object. The string is in the following format:

[NativeProcessExitEvent type=value bubbles=value cancelable=value exitCode=value]

EXIT Defines the value of the type property of a exit event object.exitString Defines the value of the type property of a exit event object. exitCode The exit code that the native process returned to the host operating system when exiting.Number The exit code that the native process returned to the host operating system when exiting. If the AIR application terminates the process by calling the exit() method of the NativeProcess object, the exitCode property is set to NaN. NOTE: on windows operating systems if the process has not exited but the runtime is exiting or an error occurred this value may be set to 259 (STILL_ACTIVE). To avoid confusion of this condition, do not use 259 as a return code in a native process.
DNSResolverEvent The DNSResolverEvent class represents the results of a Domain Name System (DNS) lookup operation.flash.events:Event The DNSResolverEvent class represents the results of a Domain Name System (DNS) lookup operation.

Use the DNSResolver lookup() method to initiate a DNS query. Resource records returned by the query are placed in the resourceRecords array of this DNSResolverEvent object.

DNSResolverlookupflash.events:DNSResolverEvent:LOOKUPflash.events:DNSResolverEventDispatched by a DNSResolver object when a look-up operation finishes. DNSResolverEvent Creates an DNSResolverEvent object that contains the results of a DNS lookup operation.typeString The type of the event. Possible values are:DNSResolverEvent.LOOKUP bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. hostStringThe query string, such as a host name, IP address, or service locator used in the call to the lookup() method of the DNSResolver class for which the new event is a response. resourceRecordsArraynullA list of the returned DNS resource records. Creates an DNSResolverEvent object that contains the results of a DNS lookup operation. Event objects are passed as parameters to event listeners. clone Creates a copy of the DNSResolverEvent object and sets the value of each property to match that of the original.A new ServerSocketConnectEvent object with property values that match those of the original. flash.events:Event Creates a copy of the DNSResolverEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the DNSResolverEvent object.A string that contains all the properties of the ProgressEvent object. String Returns a string that contains all the properties of the DNSResolverEvent object. The string is in the following format:

[DNSResolverEvent type=value bubbles=value cancelable=value host=value resourceRecords=value]

LOOKUP Defines the value of the type property of a lookup event object.lookupStringDispatched by a DNSResolver object when a look-up operation finishes. Defines the value of the type property of a lookup event object. host The query string, such as a host name, IP address, or service locator used in the call to the lookup() method of the DNSResolver class for which this event is a response.StringThe query string used in the look-up operation. The query string, such as a host name, IP address, or service locator used in the call to the lookup() method of the DNSResolver class for which this event is a response. resourceRecords An array containing the resource records returned by the DNS lookup operation.Array An array containing the resource records returned by the DNS lookup operation.
Event The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event listeners when an event occurs.Event object base class. Object The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event listeners when an event occurs.

The properties of the Event class carry basic information about an event, such as the event's type or whether the event's default behavior can be canceled. For many events, such as the events represented by the Event class constants, this basic information is sufficient. Other events, however, may require more detailed information. Events associated with a mouse click, for example, need to include additional information about the location of the click event and whether any keys were pressed during the click event. You can pass such additional information to event listeners by extending the Event class, which is what the MouseEvent class does. ActionScript 3.0 API defines several Event subclasses for common events that require additional information. Events associated with each of the Event subclasses are described in the documentation for each class.

The methods of the Event class can be used in event listener functions to affect the behavior of the event object. Some events have an associated default behavior. For example, the doubleClick event has an associated default behavior that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behavior by calling the preventDefault() method. You can also make the current event listener the last one to process an event by calling the stopPropagation() or stopImmediatePropagation() method.

Other sources of information include:

  • A useful description about the timing of events, code execution, and rendering at runtime in Ted Patrick's blog entry: Flash Player Mental Model - The Elastic Racetrack.
  • A blog entry by Johannes Tacskovics about the timing of frame events, such as ENTER_FRAME, EXIT_FRAME: The MovieClip Lifecycle.
  • An article by Trevor McCauley about the order of ActionScript operations: Order of Operations in ActionScript.
  • A blog entry by Matt Przybylski on creating custom events: AS3: Custom Events.
The following example uses the EventExample class and the Square custom class to demonstrate how to manage event bubbling. package { import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; public class EventExample extends Sprite { public function EventExample() { var square_0:Square = new Square(300, 0x336633); addChild(square_0); var square_1:Square = new Square(250, 0x669966); square_0.addChild(square_1); var square_2:Square = new Square(200, 0x66CC66); square_1.addChild(square_2); var square_3:Square = new Square(150, 0xAA0000); square_3.shouldBubble = false; square_2.addChild(square_3); var square_4:Square = new Square(100, 0x66FF66); square_3.addChild(square_4); var square_5:Square = new Square(50, 0xCC0000); square_5.shouldBubble = false; square_4.addChild(square_5); this.addEventListener(MouseEvent.CLICK, clickHandler); } private function clickHandler(e:Event):void { trace(">> stage: " + e.type + " event from " + e.target.name + " called on " + this.name); trace(">> --------------------------------------------"); } } } import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; class Square extends Sprite { private var sideLen:int; private var color:Number; public var shouldBubble:Boolean = true; public function Square(sideLen:int, color:Number) { this.sideLen = sideLen; this.color = color; init(); draw(); } private function init():void { buttonMode = true; this.addEventListener(MouseEvent.CLICK, firstClickHandler); this.addEventListener(MouseEvent.CLICK, secondClickHandler); this.addEventListener(MouseEvent.CLICK, thirdClickHandler); } private function draw():void { this.graphics.beginFill(color); this.graphics.drawRect(0, 0, sideLen, sideLen); } private function firstClickHandler(e:Event):void { trace(">> 1e: " + e.type + " event from " + e.target.name + " called on " + this.name); if(!shouldBubble) { e.stopPropagation(); } } private function secondClickHandler(e:Event):void { trace(">> 2e: " + e.type + " event from " + e.target.name + " called on " + this.name); if(!shouldBubble) { e.stopImmediatePropagation(); trace(">> --------------------------------------------"); } } private function thirdClickHandler(e:Event):void { trace(">> 3e: " + e.type + " event from " + e.target.name + " called on " + this.name); } } The following example creates an interactive demonstration of the difference between ADDED and ADDED_TO_STAGE events, as well as the difference between REMOVED and REMOVED_FROM_STAGE events. Clicking a sprite will remove it from the stage as well as everything nested within it. For example, clicking the largest sprite will cause a REMOVED event as well as three REMOVED_FROM_STAGE events to fire. package { import flash.display.Sprite; import flash.events.*; public class EventExample2 extends Sprite { public function EventExample2():void { var parentSprite:Sprite = createSprite("parentSprite",200); var childSprite:Sprite = createSprite("childSprite",100); var childOfChildSprite:Sprite = createSprite("childOfChildSprite",50); trace(":: Adding to Stage ::"); this.addChild(parentSprite); trace(":: Adding to Stage ::"); parentSprite.addChild(childSprite); trace(":: Adding to Stage ::"); childSprite.addChild(childOfChildSprite); } private function createSprite(name:String,size:uint):Sprite { trace(":: Creating Sprite ::"); var newSprite:Sprite = new Sprite(); newSprite.name = name; newSprite.graphics.beginFill(0xFFFFFF * Math.random(),1); newSprite.graphics.drawRect(0,0,size,size); newSprite.graphics.endFill(); newSprite.addEventListener(Event.ADDED, spriteAdded); newSprite.addEventListener(Event.ADDED_TO_STAGE, spriteAddedToStage); newSprite.addEventListener(Event.REMOVED, spriteRemoved); newSprite.addEventListener(Event.REMOVED_FROM_STAGE, spriteRemovedFromStage); newSprite.addEventListener(MouseEvent.CLICK, remove); return newSprite; } private function remove(event:Event) { if(event.target == event.currentTarget) { trace(":: Removing Clicked Sprite ::"); var target:Sprite = Sprite(event.target); target.parent.removeChild(target); } } private function spriteRemovedFromStage(event:Event):void { trace("REMOVED_FROM_STAGE: " + event.target.name + " : " + event.currentTarget.name); } private function spriteRemoved(event:Event):void { trace("REMOVED: " + event.target.name + " from " + event.currentTarget.name); } private function spriteAddedToStage(event:Event):void { trace("ADDED_TO_STAGE: " + event.target.name + " : " + event.currentTarget.name); } private function spriteAdded(event:Event):void { trace("ADDED: " + event.target.name + " within " + event.currentTarget.name); } } }
flash.events.EventDispatcheractivateflash.events:Event:ACTIVATEflash.events:Eventflash.events.EventDispatcher.activateDEACTIVATEaddedToStageflash.events:Event:ADDED_TO_STAGEflash.events:Eventflash.display.DisplayObject.addedToStageADDEDREMOVEDREMOVED_FROM_STAGEaddedflash.events:Event:ADDEDflash.events:Eventflash.display.DisplayObject.addedADDED_TO_STAGEREMOVEDREMOVED_FROM_STAGEcancelflash.events:Event:CANCELflash.events:Eventflash.net.FileReference.cancelchangeflash.events:Event:CHANGEflash.events:Eventflash.text.TextField.changeflash.events.TextEvent.TEXT_INPUTcopyflash.events:Event:CLEARflash.events:Eventflash.display.InteractiveObject.clearcloseflash.events:Event:CLOSEflash.events:Eventflash.net.Socket.closeflash.net.XMLSocket.closeflash.display.NativeWindow.closeclosingflash.events:Event:CLOSINGflash.events:Eventflash.display.NativeWindow.closingcompleteflash.events:Event:COMPLETEflash.events:Eventflash.display.LoaderInfo.completeflash.html.HTMLLoader.completeflash.media.Sound.completeflash.net.FileReference.completeflash.net.URLLoader.completeflash.net.URLStream.completeconnectflash.events:Event:CONNECTflash.events:Eventflash.net.Socket.connectflash.net.XMLSocket.connectcopyflash.events:Event:COPYflash.events:Eventflash.display.InteractiveObject.copycutflash.events:Event:CUTflash.events:Eventflash.display.InteractiveObject.cutdeactivateflash.events:Event:DEACTIVATEflash.events:Eventflash.events.EventDispatcher.deactivateACTIVATEdisplayingflash.events:Event:DISPLAYINGflash.events:Eventflash.display.NativeMenu.displayingflash.display.NativeMenuItem.displayingenterFrameflash.events:Event:ENTER_FRAMEflash.events:Eventflash.display.DisplayObject.enterFrameexitingflash.events:Event:EXITINGflash.events:Eventflash.desktop.NativeApplication.exitingexitFrameflash.events:Event:EXIT_FRAMEflash.events:Eventflash.display.DisplayObject.exitFrameframeConstructedflash.events:Event:FRAME_CONSTRUCTEDflash.events:Eventflash.display.DisplayObject.frameConstructedfullScreenflash.events:Event:FULLSCREENflash.events:Eventflash.display.Stage.fullScreenhtmlBoundsChangeflash.events:Event:HTML_BOUNDS_CHANGEflash.events:EventhtmlBoundsChange eventhtmlDOMInitializeflash.events:Event:HTML_DOM_INITIALIZEflash.events:EventhtmlDOMInitialize eventhtmlRenderflash.events:Event:HTML_RENDERflash.events:EventhtmlRender eventid3flash.events:Event:ID3flash.events:Eventflash.media.Sound.id3initflash.events:Event:INITflash.events:Eventflash.display.LoaderInfo.initlocationChangeflash.events:Event:LOCATION_CHANGEflash.events:EventlocationChange eventmouseLeaveflash.events:Event:MOUSE_LEAVEflash.events:Eventflash.display.Stage.mouseLeaveflash.events.MouseEventnetworkChangeflash.events:Event:NETWORK_CHANGEflash.events:Eventflash.desktop.NativeApplication.networkChangeopenflash.events:Event:OPENflash.events:Eventflash.display.LoaderInfo.openflash.media.Sound.openflash.net.FileReference.openflash.net.URLLoader.openflash.net.URLStream.openpasteflash.events:Event:PASTEflash.events:Eventflash.display.InteractiveObject.pasteflash.events.Eventflash.events:Event:PREPARINGflash.events:Eventflash.display.NativeMenu.preparingflash.display.NativeMenuItem.preparingremovedFromStageflash.events:Event:REMOVED_FROM_STAGEflash.events:Eventflash.display.DisplayObject.removedFromStageADDEDREMOVEDADDED_TO_STAGEremovedflash.events:Event:REMOVEDflash.events:Eventflash.display.DisplayObject.removedADDEDADDED_TO_STAGEREMOVED_FROM_STAGErenderflash.events:Event:RENDERflash.events:Eventflash.display.DisplayObject.renderflash.display.Stage.invalidate()resizeflash.events:Event:RESIZEflash.events:Eventflash.display.Stage.resizescrollflash.events:Event:SCROLLflash.events:Eventflash.text.TextField.scrollflash.html.HTMLLoader.scrollselectAllflash.events:Event:SELECT_ALLflash.events:Eventflash.display.InteractiveObject.selectAllselectflash.events:Event:SELECTflash.events:Eventflash.net.FileReference.selectflash.display.NativeMenu.selectflash.display.NativeMenuItem.selectsoundCompleteflash.events:Event:SOUND_COMPLETEflash.events:Eventflash.media.SoundChannel.soundCompleteflash.events.Eventflash.events:Event:STANDARD_ERROR_CLOSEflash.events:Eventflash.events.Eventflash.events:Event:STANDARD_INPUT_CLOSEflash.events:Eventflash.events.Eventflash.events:Event:STANDARD_OUTPUT_CLOSEflash.events:EventtabChildrenChangeflash.events:Event:TAB_CHILDREN_CHANGEflash.events:Eventflash.display.InteractiveObject.tabChildrenChangetabEnabledChangeflash.events:Event:TAB_ENABLED_CHANGEflash.events:Eventflash.display.InteractiveObject.tabEnabledChangetabIndexChangeflash.events:Event:TAB_INDEX_CHANGEflash.events:Eventflash.display.InteractiveObject.tabIndexChangetextInteractionModeChangeflash.events:Event:TEXT_INTERACTION_MODE_CHANGEflash.events:Eventflash.text.TextField.textInteractionModeChangeunloadflash.events:Event:UNLOADflash.events:Eventflash.display.LoaderInfo.unloaduserIdleflash.events:Event:USER_IDLEflash.events:Eventflash.desktop.NativeApplication.userIdleuserIdleflash.events:Event:USER_PRESENTflash.events:Eventflash.desktop.NativeApplication.userPresentEvent Creates an Event object to pass as a parameter to event listeners.typeString The type of the event, accessible as Event.type. bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. cancelableBooleanfalseDetermines whether the Event object can be canceled. The default values is false. Used to create new Event object. Creates an Event object to pass as a parameter to event listeners. clone Duplicates an instance of an Event subclass.A new Event object that is identical to the original. flash.events:Event Duplicates an instance of an Event subclass.

Returns a new Event object that is a copy of the original instance of the Event object. You do not normally call clone(); the EventDispatcher class calls it automatically when you redispatch an event—that is, when you call dispatchEvent(event) from a handler that is handling event.

The new Event object includes all the properties of the original.

When creating your own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when listeners handle the redispatched event.

In this example, PingEvent is a subclass of Event and therefore implements its own version of clone().

class PingEvent extends Event { var URL:String; public override function clone():Event { return new PingEvent(type, bubbles, cancelable, URL); } }
formatToString A utility function for implementing the toString() method in custom ActionScript 3.0 Event classes.The name of your custom Event class and the String value of your ...arguments parameter. StringclassNameStringThe name of your custom Event class. In the previous example, the className parameter is PingEvent. argumentsThe properties of the Event class and the properties that you add in your custom Event class. In the previous example, the ...arguments parameter includes type, bubbles, cancelable, eventPhase, and URL. A utility function for implementing the toString() method in custom ActionScript 3.0 Event classes. Overriding the toString() method is recommended, but not required.
	 class PingEvent extends Event {
	  var URL:String;
	 
	 public override function toString():String { 
	  return formatToString("PingEvent", "type", "bubbles", "cancelable", "eventPhase", "URL"); 
	    }
	 }
	 
isDefaultPrevented Checks whether the preventDefault() method has been called on the event.If preventDefault() has been called, returns true; otherwise, returns false. Boolean Checks whether the preventDefault() method has been called on the event. If the preventDefault() method has been called, returns true; otherwise, returns false. flash.events.Event.preventDefault()preventDefault Cancels an event's default behavior if that behavior can be canceled. Cancels an event's default behavior if that behavior can be canceled.

Many events have associated behaviors that are carried out by default. For example, if a user types a character into a text field, the default behavior is that the character is displayed in the text field. Because the TextEvent.TEXT_INPUT event's default behavior can be canceled, you can use the preventDefault() method to prevent the character from appearing.

An example of a behavior that is not cancelable is the default behavior associated with the Event.REMOVED event, which is generated whenever Flash Player is about to remove a display object from the display list. The default behavior (removing the element) cannot be canceled, so the preventDefault() method has no effect on this default behavior.

You can use the Event.cancelable property to check whether you can prevent the default behavior associated with a particular event. If the value of Event.cancelable is true, then preventDefault() can be used to cancel the event; otherwise, preventDefault() has no effect.

flash.events.Event.isDefaultPrevented()Event.cancelable
stopImmediatePropagation Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. This method takes effect immediately, and it affects event listeners in the current node. In contrast, the stopPropagation() method doesn't take effect until all the event listeners in the current node finish processing.

Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality.

flash.events.Event.stopPropagation()flash.events.Event.preventDefault()
stopPropagation Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method does not affect any event listeners in the current node (currentTarget). In contrast, the stopImmediatePropagation() method prevents processing of event listeners in both the current node and subsequent nodes. Additional calls to this method have no effect. This method can be called in any phase of the event flow.

Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality.

flash.events.Event.stopImmediatePropagation()flash.events.Event.preventDefault()
toString Returns a string containing all the properties of the Event object.A string containing all the properties of the Event object. String Returns a string containing all the properties of the Event object. The string is in the following format:

[Event type=value bubbles=value cancelable=value]

ACTIVATE The ACTIVATE constant defines the value of the type property of an activate event object.activateString The ACTIVATE constant defines the value of the type property of an activate event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

AIR for TV devices never automatically dispatch this event. You can, however, dispatch it manually.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny DisplayObject instance with a listener registered for the activate event.
flash.events.EventDispatcher.activateDEACTIVATE
ADDED_TO_STAGE The Event.ADDED_TO_STAGE constant defines the value of the type property of an addedToStage event object.addedToStageString The Event.ADDED_TO_STAGE constant defines the value of the type property of an addedToStage event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe DisplayObject instance being added to the on stage display list, either directly or through the addition of a sub tree in which the DisplayObject instance is contained. If the DisplayObject instance is being directly added, the added event occurs before this event.
flash.display.DisplayObject.addedToStageADDEDREMOVEDREMOVED_FROM_STAGE
ADDED The Event.ADDED constant defines the value of the type property of an added event object.addedString The Event.ADDED constant defines the value of the type property of an added event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe DisplayObject instance being added to the display list. 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.
flash.display.DisplayObject.addedADDED_TO_STAGEREMOVEDREMOVED_FROM_STAGE
CANCEL The Event.CANCEL constant defines the value of the type property of a cancel event object.cancelString The Event.CANCEL constant defines the value of the type property of a cancel event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetA reference to the object on which the operation is canceled.
flash.net.FileReference.cancel
CHANGE The Event.CHANGE constant defines the value of the type property of a change event object.changeString The Event.CHANGE constant defines the value of the type property of a change event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object that has had its value modified. 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.
flash.text.TextField.changeflash.events.TextEvent.TEXT_INPUT
CLEAR The Event.CLEAR constant defines the value of the type property of a clear event object.clearString The Event.CLEAR constant defines the value of the type property of a clear event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny InteractiveObject instance with a listener registered for the clear event.

Note: TextField objects do not dispatch clear, copy, cut, paste, or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu. You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands (or their keyboard equivalents) does not generate clear, copy, cut, paste, or selectAll events. However, other classes that extend the InteractiveObject class, including components built using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

flash.display.InteractiveObject.clear
CLOSE The Event.CLOSE constant defines the value of the type property of a close event object.closeString The Event.CLOSE constant defines the value of the type property of a close event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object whose connection has been closed.
flash.net.Socket.closeflash.net.XMLSocket.closeflash.display.NativeWindow.close
CLOSING The Event.CLOSING constant defines the value of the type property of a closing event object.closingString The Event.CLOSING constant defines the value of the type property of a closing event object.

This event has the following properties:

PropertyValuebubblesfalsecancelabletrue; canceling this event object stops the close operation.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object whose connection is to be closed.
flash.display.NativeWindow.closing
COMPLETE The Event.COMPLETE constant defines the value of the type property of a complete event object.completeString The Event.COMPLETE constant defines the value of the type property of a complete event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; 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.
flash.display.LoaderInfo.completeflash.html.HTMLLoader.completeflash.media.Sound.completeflash.net.FileReference.completeflash.net.URLLoader.completeflash.net.URLStream.complete
CONNECT The Event.CONNECT constant defines the value of the type property of a connect event object.connectString The Event.CONNECT constant defines the value of the type property of a connect event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe Socket or XMLSocket object that has established a network connection.
flash.net.Socket.connectflash.net.XMLSocket.connect
COPY Defines the value of the type property of a copy event object.copyString Defines the value of the type property of a copy event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny InteractiveObject instance with a listener registered for the copy event.

Note: TextField objects do not dispatch clear, copy, cut, paste, or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu. You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands (or their keyboard equivalents) does not generate clear, copy, cut, paste, or selectAll events. However, other classes that extend the InteractiveObject class, including components built using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

flash.display.InteractiveObject.copy
CUT Defines the value of the type property of a cut event object.cutString Defines the value of the type property of a cut event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny InteractiveObject instance with a listener registered for the cut event.

Note: TextField objects do not dispatch clear, copy, cut, paste, or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu. You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands (or their keyboard equivalents) does not generate clear, copy, cut, paste, or selectAll events. However, other classes that extend the InteractiveObject class, including components built using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

flash.display.InteractiveObject.cut
DEACTIVATE The Event.DEACTIVATE constant defines the value of the type property of a deactivate event object.deactivateString The Event.DEACTIVATE constant defines the value of the type property of a deactivate event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

AIR for TV devices never automatically dispatch this event. You can, however, dispatch it manually.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny DisplayObject instance with a listener registered for the deactivate event.
flash.events.EventDispatcher.deactivateACTIVATE
DISPLAYING The Event.DISPLAYING constant defines the value of the type property of a displaying event object.displayingString The Event.DISPLAYING constant defines the value of the type property of a displaying event object.

Note: This event does not go through a "capture phase" and is dispatched directly to the target, whether the target is on the display list or not.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalsecurrentTargetThe object that is actively processing the Event object with an event listener.targetThe object that is about to be displayed.
flash.display.NativeMenu.displayingflash.display.NativeMenuItem.displaying
ENTER_FRAME The Event.ENTER_FRAME constant defines the value of the type property of an enterFrame event object.enterFrameString The Event.ENTER_FRAME constant defines the value of the type property of an enterFrame event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny DisplayObject instance with a listener registered for the enterFrame event.
flash.display.DisplayObject.enterFrame
EXITING The Event.EXITING constant defines the value of the type property of an exiting event object.exitingString The Event.EXITING constant defines the value of the type property of an exiting event object.

This event has the following properties:

PropertyValuebubblesfalsecancelabletrue; canceling this event object stops the exit operation.currentTargetThe NativeApplication object.targetThe NativeApplication object.
flash.desktop.NativeApplication.exiting
EXIT_FRAME The Event.EXIT_FRAME constant defines the value of the type property of an exitFrame event object.exitFrameString The Event.EXIT_FRAME constant defines the value of the type property of an exitFrame event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny DisplayObject instance with a listener registered for the enterFrame event.
flash.display.DisplayObject.exitFrame
FRAME_CONSTRUCTED The Event.FRAME_CONSTRUCTED constant defines the value of the type property of an frameConstructed event object.frameConstructedString The Event.FRAME_CONSTRUCTED constant defines the value of the type property of an frameConstructed event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny DisplayObject instance with a listener registered for the frameConstructed event.
flash.display.DisplayObject.frameConstructed
FULLSCREEN The Event.FULL_SCREEN constant defines the value of the type property of a fullScreen event object.fullScreenString The Event.FULL_SCREEN constant defines the value of the type property of a fullScreen event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe Stage object.
flash.display.Stage.fullScreen
HTML_BOUNDS_CHANGE The Event.HTML_BOUNDS_CHANGE constant defines the value of the type property of an htmlBoundsChange event object.htmlBoundsChangeString The Event.HTML_BOUNDS_CHANGE constant defines the value of the type property of an htmlBoundsChange event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe HTMLLoader object.targetThe HTMLLoader object.
htmlBoundsChange event
HTML_DOM_INITIALIZE The Event.HTML_DOM_INITIALIZE constant defines the value of the type property of an htmlDOMInitialize event object.htmlDOMInitializeString The Event.HTML_DOM_INITIALIZE constant defines the value of the type property of an htmlDOMInitialize event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe HTMLLoader object.targetThe HTMLLoader object.
htmlDOMInitialize event
HTML_RENDER The Event.HTML_RENDER constant defines the value of the type property of an htmlRender event object.htmlRenderString The Event.HTML_RENDER constant defines the value of the type property of an htmlRender event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe HTMLLoader object.targetThe HTMLLoader object.
htmlRender event
ID3 The Event.ID3 constant defines the value of the type property of an id3 event object.id3String The Event.ID3 constant defines the value of the type property of an id3 event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe Sound object loading the MP3 for which ID3 data is now available. 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.
flash.media.Sound.id3
INIT The Event.INIT constant defines the value of the type property of an init event object.initString The Event.INIT constant defines the value of the type property of an init event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe LoaderInfo object associated with the SWF file being loaded.
flash.display.LoaderInfo.init
LOCATION_CHANGE The Event.LOCATION_CHANGE constant defines the value of the type property of a locationChange event object.locationChangeString The Event.LOCATION_CHANGE constant defines the value of the type property of a locationChange event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe HTMLLoader object.targetThe HTMLLoader object.
locationChange event
MOUSE_LEAVE The Event.MOUSE_LEAVE constant defines the value of the type property of a mouseLeave event object.mouseLeaveString The Event.MOUSE_LEAVE constant defines the value of the type property of a mouseLeave event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe Stage 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.
flash.display.Stage.mouseLeaveflash.events.MouseEvent
NETWORK_CHANGE The Event.NETWORK_CHANGE constant defines the value of the type property of a networkChange event object.networkChangeString The Event.NETWORK_CHANGE constant defines the value of the type property of a networkChange event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe NativeApplication object.
flash.desktop.NativeApplication.networkChange
OPEN The Event.OPEN constant defines the value of the type property of an open event object.openString The Event.OPEN constant defines the value of the type property of an open event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; 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 opened a connection.
flash.display.LoaderInfo.openflash.media.Sound.openflash.net.FileReference.openflash.net.URLLoader.openflash.net.URLStream.open
PASTE The Event.PASTE constant defines the value of the type property of a paste event object.pasteString The Event.PASTE constant defines the value of the type property of a paste event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny InteractiveObject instance with a listener registered for the paste event.

Note: TextField objects do not dispatch clear, copy, cut, paste, or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu. You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands (or their keyboard equivalents) does not generate clear, copy, cut, paste, or selectAll events. However, other classes that extend the InteractiveObject class, including components built using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

flash.display.InteractiveObject.paste
PREPARING The Event.PREPARING constant defines the value of the type property of a preparing event object.preparingString The Event.PREPARING constant defines the value of the type property of a preparing event object.

Note: This event does not go through a "capture phase" and is dispatched directly to the target, whether the target is on the display list or not.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalsecurrentTargetThe object that dispatched this event.targetThe object that dispatched this event.
flash.display.NativeMenu.preparingflash.display.NativeMenuItem.preparing
REMOVED_FROM_STAGE The Event.REMOVED_FROM_STAGE constant defines the value of the type property of a removedFromStage event object.removedFromStageString The Event.REMOVED_FROM_STAGE constant defines the value of the type property of a removedFromStage event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe DisplayObject instance being removed from the on stage display list, either directly or through the removal of a sub tree in which the DisplayObject instance is contained. If the DisplayObject instance is being directly removed, the removed event occurs before this event.
flash.display.DisplayObject.removedFromStageADDEDREMOVEDADDED_TO_STAGE
REMOVED The Event.REMOVED constant defines the value of the type property of a removed event object.removedString The Event.REMOVED constant defines the value of the type property of a removed event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe DisplayObject instance to be removed from the display list. 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.
flash.display.DisplayObject.removedADDEDADDED_TO_STAGEREMOVED_FROM_STAGE
RENDER The Event.RENDER constant defines the value of the type property of a render event object.renderString The Event.RENDER constant defines the value of the type property of a render event object.

Note: This event has neither a "capture phase" nor a "bubble phase", which means that event listeners must be added directly to any potential targets, whether the target is on the display list or not.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; the default behavior cannot be canceled.currentTargetThe object that is actively processing the Event object with an event listener.targetAny DisplayObject instance with a listener registered for the render event.
flash.display.DisplayObject.renderflash.display.Stage.invalidate()
RESIZE The Event.RESIZE constant defines the value of the type property of a resize event object.resizeString The Event.RESIZE constant defines the value of the type property of a resize event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe Stage object.
flash.display.Stage.resize
SCROLL The Event.SCROLL constant defines the value of the type property of a scroll event object.scrollString The Event.SCROLL constant defines the value of the type property of a scroll event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe TextField object that has been scrolled. The target property 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.
flash.text.TextField.scrollflash.html.HTMLLoader.scroll
SELECT_ALL The Event.SELECT_ALL constant defines the value of the type property of a selectAll event object.selectAllString The Event.SELECT_ALL constant defines the value of the type property of a selectAll event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetAny InteractiveObject instance with a listener registered for the selectAll event.

Note: TextField objects do not dispatch clear, copy, cut, paste, or selectAll events. TextField objects always include Cut, Copy, Paste, Clear, and Select All commands in the context menu. You cannot remove these commands from the context menu for TextField objects. For TextField objects, selecting these commands (or their keyboard equivalents) does not generate clear, copy, cut, paste, or selectAll events. However, other classes that extend the InteractiveObject class, including components built using the Flash Text Engine (FTE), will dispatch these events in response to user actions such as keyboard shortcuts and context menus.

flash.display.InteractiveObject.selectAll
SELECT The Event.SELECT constant defines the value of the type property of a select event object.selectString The Event.SELECT constant defines the value of the type property of a select event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object on which an item has been selected.
flash.net.FileReference.selectflash.display.NativeMenu.selectflash.display.NativeMenuItem.select
SOUND_COMPLETE The Event.SOUND_COMPLETE constant defines the value of the type property of a soundComplete event object.soundCompleteString The Event.SOUND_COMPLETE constant defines the value of the type property of a soundComplete event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe SoundChannel object in which a sound has finished playing.
flash.media.SoundChannel.soundComplete
STANDARD_ERROR_CLOSE The Event.STANDARD_ERROR_CLOSE constant defines the value of the type property of a standardErrorClose event object.standardErrorCloseString The Event.STANDARD_ERROR_CLOSE constant defines the value of the type property of a standardErrorClose event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.targetThe NativeProcess object.
STANDARD_INPUT_CLOSE The Event.STANDARD_INPUT_CLOSE constant defines the value of the type property of a standardInputClose event object.standardInputCloseString The Event.STANDARD_INPUT_CLOSE constant defines the value of the type property of a standardInputClose event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.targetThe NativeProcess object.
STANDARD_OUTPUT_CLOSE The Event.STANDARD_OUTPUT_CLOSE constant defines the value of the type property of a standardOutputClose event object.standardOutputCloseString The Event.STANDARD_OUTPUT_CLOSE constant defines the value of the type property of a standardOutputClose event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.targetThe NativeProcess object.
TAB_CHILDREN_CHANGE The Event.TAB_CHILDREN_CHANGE constant defines the value of the type property of a tabChildrenChange event object.tabChildrenChangeString The Event.TAB_CHILDREN_CHANGE constant defines the value of the type property of a tabChildrenChange event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object whose tabChildren flag has changed. 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.
flash.display.InteractiveObject.tabChildrenChange
TAB_ENABLED_CHANGE The Event.TAB_ENABLED_CHANGE constant defines the value of the type property of a tabEnabledChange event object.tabEnabledChangeString The Event.TAB_ENABLED_CHANGE constant defines the value of the type property of a tabEnabledChange event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe InteractiveObject whose tabEnabled flag has changed. 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.
flash.display.InteractiveObject.tabEnabledChange
TAB_INDEX_CHANGE The Event.TAB_INDEX_CHANGE constant defines the value of the type property of a tabIndexChange event object.tabIndexChangeString The Event.TAB_INDEX_CHANGE constant defines the value of the type property of a tabIndexChange event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object whose tabIndex has changed. 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.
flash.display.InteractiveObject.tabIndexChange
TEXT_INTERACTION_MODE_CHANGE The Event.TEXT_INTERACTION_MODE_CHANGE constant defines the value of the type property of a interaction mode event object.textInteractionModeChangeString The Event.TEXT_INTERACTION_MODE_CHANGE constant defines the value of the type property of a interaction mode event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe TextField object whose interaction mode property is changed. For example on Android, one can change the interaction mode to SELECTION via context menu. The target property 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.
flash.text.TextField.textInteractionModeChange
UNLOAD The Event.UNLOAD constant defines the value of the type property of an unload event object.unloadString The Event.UNLOAD constant defines the value of the type property of an unload event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe LoaderInfo object associated with the SWF file being unloaded or replaced.
flash.display.LoaderInfo.unload
USER_IDLE The Event.USER_IDLE constant defines the value of the type property of a userIdle event object.userIdleString The Event.USER_IDLE constant defines the value of the type property of a userIdle event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.targetThe NativeApplication object.
flash.desktop.NativeApplication.userIdle
USER_PRESENT The Event.USER_PRESENT constant defines the value of the type property of a userPresent event object.userPresentString The Event.USER_PRESENT constant defines the value of the type property of a userPresent event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.targetThe NativeApplication object.
flash.desktop.NativeApplication.userPresent
bubbles Indicates whether an event is a bubbling event.Boolean Indicates whether an event is a bubbling event. If the event can bubble, this value is true; otherwise it is false.

When an event occurs, it moves through the three phases of the event flow: the capture phase, which flows from the top of the display list hierarchy to the node just before the target node; the target phase, which comprises the target node; and the bubbling phase, which flows from the node subsequent to the target node back up the display list hierarchy.

Some events, such as the activate and unload events, do not have a bubbling phase. The bubbles property has a value of false for events that do not have a bubbling phase.

cancelable Indicates whether the behavior associated with the event can be prevented.Boolean Indicates whether the behavior associated with the event can be prevented. If the behavior can be canceled, this value is true; otherwise it is false. Event.preventDefault()currentTarget The object that is actively processing the Event object with an event listener.Object The object that is actively processing the Event object with an event listener. For example, if a user clicks an OK button, the current target could be the node containing that button or one of its ancestors that has registered an event listener for that event. eventPhase The current phase in the event flow.uint The current phase in the event flow. This property can contain the following numeric values:
  • The capture phase (EventPhase.CAPTURING_PHASE).
  • The target phase (EventPhase.AT_TARGET).
  • The bubbling phase (EventPhase.BUBBLING_PHASE).
target The event target.Object The event target. This property contains the target node. For example, if a user clicks an OK button, the target node is the display list node containing that button. type The type of event.String The type of event. The type is case-sensitive.
TextEvent An object dispatches a TextEvent object when a user enters text in a text field or clicks a hyperlink in an HTML-enabled text field.Event objects for TextEvent events. flash.events:Event An object dispatches a TextEvent object when a user enters text in a text field or clicks a hyperlink in an HTML-enabled text field. There are two types of text events: TextEvent.LINK and TextEvent.TEXT_INPUT. The following example uses the TextEventExample class to create text fields and to listen for various text events on them. The example carries out the following tasks:
  1. The example declares constants for two URLs to be used later.
  2. The example declares two variables of type TextField to be used later.
  3. The class constructor calls the following two methods:
    • init() initializes the TextField objects and add event listeners to them.
    • draw() adds the TextFields to the display list and assigns the text to be displayed.
  4. The listeners linkHandler() and textInputHandler() react to the events according to their event type. The linkHandler() method opens a web browser if one is not open already and navigates to the clicked URL. The textInputHandler() method simply displays information every time a key is pressed in the associated text field.

Note: The domain shown in this example is fictitious and [yourDomain] should be replaced with a real domain.

package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFieldAutoSize; import flash.events.TextEvent; import flash.events.TextEvent; import flash.net.URLRequest; import flash.net.navigateToURL; public class TextEventExample extends Sprite { private const DOMAIN_1_URL:String = "http://www.[yourDomain].com"; private const DOMAIN_2_URL:String = "http://www.[yourDomain].com"; private var linkTxt:TextField; private var textInputTxt:TextField; public function TextEventExample() { init(); draw(); } private function init():void { linkTxt = new TextField(); linkTxt.addEventListener(TextEvent.LINK, linkHandler); linkTxt.height = 60; linkTxt.autoSize = TextFieldAutoSize.LEFT; linkTxt.multiline = true; textInputTxt = new TextField(); textInputTxt.addEventListener(TextEvent.TEXT_INPUT, textInputHandler); textInputTxt.type = TextFieldType.INPUT; textInputTxt.background = true; textInputTxt.border = true; textInputTxt.height = 20; } private function draw():void { addChild(linkTxt); linkTxt.htmlText += createLink(DOMAIN_1_URL, "Click to go to first domain"); linkTxt.htmlText += "<br />"; linkTxt.htmlText += createLink(DOMAIN_2_URL, "Click to go to second domain"); addChild(textInputTxt); textInputTxt.y = linkTxt.height; textInputTxt.text = "type here"; } private function createLink(url:String, text:String):String { var link:String = ""; link += "<font color='#0000FF'>"; link += "<u>"; link += "<b>"; link += "<a href='event:" + url + "'>" + text + "</a>"; link += "</b>"; link += "</u>"; link += "</font>"; return link; } private function linkHandler(e:TextEvent):void { var request:URLRequest = new URLRequest(e.text); navigateToURL(request); } private function textInputHandler(e:TextEvent):void { trace(">> ============================"); trace(">> e.text: " + e.text); trace(">> textInputTxt.text: " + textInputTxt.text); } } }
flash.text.TextFieldlinkflash.events:TextEvent:LINKflash.events:TextEvent In this example, when a user clicks a hyperlink in HTML text, it triggers a text event. Depending on the link, the user is sent to a designated website based on the system's operating system, or a circle is drawn based on the user's selected radius.

A text field is created and its content is set to an HTML-formatted string by using the htmlText property. The links are underlined for easier identification by the user. (Adobe Flash Player changes the mouse pointer only after the pointer is over the link.) To make sure that the user's click invokes an ActionScript method, the URL of the link begins with the "event:" string and a listener is added for the TextEvent.LINK event.

The linkHandler() method that is triggered after the user clicks a link manages all the link events for the text field. The first if statement checks the text property of the event, which holds the remainder of the URL after the "event:" string. If the user clicked the link for the operating system, the name of the user's current operating system, taken from the system's Capabilities.os property, is used to send the user to the designated website. Otherwise, the selected radius size, passed by the event's text property, is used to draw a circle below the text field. Each time the user clicks the radius link, the previously drawn circle is cleared and a new red circle with the selected radius size is drawn.

package { import flash.display.Sprite; import flash.events.TextEvent; import flash.errors.IOError; import flash.events.IOErrorEvent; import flash.system.Capabilities; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.display.Shape; import flash.display.Graphics; public class TextEvent_LINKExample extends Sprite { private var myCircle:Shape = new Shape(); public function TextEvent_LINKExample() { var myTextField:TextField = new TextField(); myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.multiline = true; myTextField.background = true; myTextField.htmlText = "Draw a circle with the radius of <u><a href=\"event:20\">20 pixels</a></u>.<br>" + "Draw a circle with the radius of <u><a href=\"event:50\">50 pixels</a></u>.<br><br>" + "<u><a href=\"event:os\">Learn about your operating system.</a></u><br>"; myTextField.addEventListener(TextEvent.LINK, linkHandler); this.addChild(myTextField); this.addChild(myCircle); } private function linkHandler(e:TextEvent):void { var osString:String = Capabilities.os; if(e.text == "os") { if (osString.search(/Windows/) != -1 ){ navigateToURL(new URLRequest("http://www.microsoft.com/"), "_self"); }else if (osString.search(/Mac/) != -1 ) { navigateToURL(new URLRequest("http://www.apple.com/"), "_self"); } else if (osString.search(/linux/i)!= -1) { navigateToURL(new URLRequest("http://www.tldp.org/"), "_self"); } } else { myCircle.graphics.clear(); myCircle.graphics.beginFill(0xFF0000); myCircle.graphics.drawCircle(100, 150, Number(e.text)); myCircle.graphics.endFill(); } } } }
textflash.text.TextField.link
textInputflash.events:TextEvent:TEXT_INPUTflash.events:TextEvent The following example guides the user in generating a special combination key (similar to a password). This combination key has seven alphanumeric characters, where the second and fifth characters are numeric.

Three text fields for the preliminary instructions, the user input, and the warning (error) messages are created. An event listener is added to respond to the user's text input by triggering the textInputHandler() method. (Every time the user enters text, a TextEvent.TEXT_INPUT event is dispatched.

Note: The text events are dispatched when a user enters characters and not as a response to any keyboard input, such as backspace. To catch all keyboard events, use a listener for the KeyboardEvent event.)

The textInputHandler() method controls and manages the user input. The preventDefault() method is used to prevent Adobe Flash Player from immediately displaying the text in the input text field. The application is responsible for updating the field. To undo the user's deletion or modification to the characters already entered (the result string), the content of the input text field is reassigned to the result string when a user enters new characters. Also, to produce a consistent user experience, the setSelection() method places the insertion point (a caret) after the last selected character in the text field.

The first if statement in the textInputHandler() method checks the input for the second and fifth character positions of the combination key, which must be numbers. If the user input is correct, the updateCombination() method is called and the (result) combination key string is appended with the user input. The updateCombination() method also moves the insertion point after the selected character. After the seven characters are entered, the last if statement in the textInputHandler() method changes type of the inputTextField text field from INPUT to DYNAMIC, which means that the user can no longer enter or change any characters.

package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFieldAutoSize; import flash.events.TextEvent; public class TextEvent_TEXT_INPUTExample extends Sprite { private var instructionTextField:TextField = new TextField(); private var inputTextField:TextField = new TextField(); private var warningTextField:TextField = new TextField(); private var result:String = ""; public function TextEvent_TEXT_INPUTExample() { instructionTextField.x = 10; instructionTextField.y = 10; instructionTextField.background = true; instructionTextField.autoSize = TextFieldAutoSize.LEFT; instructionTextField.text = "Please enter a value in the format A#AA#AA,\n" + "where 'A' represents a letter and '#' represents a number.\n" + "(Note that once you input a character you can't change it.)" ; inputTextField.x = 10; inputTextField.y = 70; inputTextField.height = 20; inputTextField.width = 75; inputTextField.background = true; inputTextField.border = true; inputTextField.type = TextFieldType.INPUT; warningTextField.x = 10; warningTextField.y = 100; warningTextField.autoSize = TextFieldAutoSize.LEFT; inputTextField.addEventListener(TextEvent.TEXT_INPUT, textInputHandler); this.addChild(instructionTextField); this.addChild(inputTextField); this.addChild(warningTextField); } private function textInputHandler(event:TextEvent):void { var charExp:RegExp = /[a-zA-z]/; var numExp:RegExp = /[0-9]/; event.preventDefault(); inputTextField.text = result; inputTextField.setSelection(result.length + 1, result.length + 1); if (inputTextField.text.length == 1 || inputTextField.text.length == 4) { if(numExp.test(event.text) == true) { updateCombination(event.text); } else { warningTextField.text = "You need a single digit number."; } }else { if(charExp.test(event.text) == true) { updateCombination(event.text); } else { warningTextField.text = "You need an alphabet character."; } } if(inputTextField.text.length == 7) { inputTextField.type = TextFieldType.DYNAMIC; instructionTextField.text = "CONGRATULATIONS. You've done."; } } private function updateCombination(s:String):void { warningTextField.text = ""; result += s; inputTextField.text = result; inputTextField.setSelection(result.length + 1, result.length + 1); } } }
flash.text.TextField.textInputtext
TextEvent Creates an Event object that contains information about text events.typeString The type of the event. Event listeners can access this information through the inherited type property. Possible values are: TextEvent.LINK and TextEvent.TEXT_INPUT. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. textStringOne or more characters of text entered by the user. Event listeners can access this information through the text property. Constructor for TextEvent objects. Creates an Event object that contains information about text events. Event objects are passed as parameters to event listeners. flash.text.TextFieldclone Creates a copy of the TextEvent object and sets the value of each property to match that of the original.A new TextEvent object with property values that match those of the original. flash.events:Event Creates a copy of the TextEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the TextEvent object.A string that contains all the properties of the TextEvent object. String Returns a string that contains all the properties of the TextEvent object. The string is in the following format:

[TextEvent type=value bubbles=value cancelable=value text=value]

LINK Defines the value of the type property of a link event object.linkString Defines the value of the type property of a link event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe text field containing the hyperlink that has been clicked. 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.textThe remainder of the URL after "event:"
In this example, when a user clicks a hyperlink in HTML text, it triggers a text event. Depending on the link, the user is sent to a designated website based on the system's operating system, or a circle is drawn based on the user's selected radius.

A text field is created and its content is set to an HTML-formatted string by using the htmlText property. The links are underlined for easier identification by the user. (Adobe Flash Player changes the mouse pointer only after the pointer is over the link.) To make sure that the user's click invokes an ActionScript method, the URL of the link begins with the "event:" string and a listener is added for the TextEvent.LINK event.

The linkHandler() method that is triggered after the user clicks a link manages all the link events for the text field. The first if statement checks the text property of the event, which holds the remainder of the URL after the "event:" string. If the user clicked the link for the operating system, the name of the user's current operating system, taken from the system's Capabilities.os property, is used to send the user to the designated website. Otherwise, the selected radius size, passed by the event's text property, is used to draw a circle below the text field. Each time the user clicks the radius link, the previously drawn circle is cleared and a new red circle with the selected radius size is drawn.

package { import flash.display.Sprite; import flash.events.TextEvent; import flash.errors.IOError; import flash.events.IOErrorEvent; import flash.system.Capabilities; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.display.Shape; import flash.display.Graphics; public class TextEvent_LINKExample extends Sprite { private var myCircle:Shape = new Shape(); public function TextEvent_LINKExample() { var myTextField:TextField = new TextField(); myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.multiline = true; myTextField.background = true; myTextField.htmlText = "Draw a circle with the radius of <u><a href=\"event:20\">20 pixels</a></u>.<br>" + "Draw a circle with the radius of <u><a href=\"event:50\">50 pixels</a></u>.<br><br>" + "<u><a href=\"event:os\">Learn about your operating system.</a></u><br>"; myTextField.addEventListener(TextEvent.LINK, linkHandler); this.addChild(myTextField); this.addChild(myCircle); } private function linkHandler(e:TextEvent):void { var osString:String = Capabilities.os; if(e.text == "os") { if (osString.search(/Windows/) != -1 ){ navigateToURL(new URLRequest("http://www.microsoft.com/"), "_self"); }else if (osString.search(/Mac/) != -1 ) { navigateToURL(new URLRequest("http://www.apple.com/"), "_self"); } else if (osString.search(/linux/i)!= -1) { navigateToURL(new URLRequest("http://www.tldp.org/"), "_self"); } } else { myCircle.graphics.clear(); myCircle.graphics.beginFill(0xFF0000); myCircle.graphics.drawCircle(100, 150, Number(e.text)); myCircle.graphics.endFill(); } } } }
textflash.text.TextField.link
TEXT_INPUT Defines the value of the type property of a textInput event object.textInputString Defines the value of the type property of a textInput event object.

Note: This event is not dispatched for the Delete or Backspace keys.

This event has the following properties:

PropertyValuebubblestruecancelabletrue; call the preventDefault() method to cancel default behavior.currentTargetThe object that is actively processing the Event object with an event listener.targetThe text field into which characters are being entered. 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.textThe character or sequence of characters entered by the user.
The following example guides the user in generating a special combination key (similar to a password). This combination key has seven alphanumeric characters, where the second and fifth characters are numeric.

Three text fields for the preliminary instructions, the user input, and the warning (error) messages are created. An event listener is added to respond to the user's text input by triggering the textInputHandler() method. (Every time the user enters text, a TextEvent.TEXT_INPUT event is dispatched.

Note: The text events are dispatched when a user enters characters and not as a response to any keyboard input, such as backspace. To catch all keyboard events, use a listener for the KeyboardEvent event.)

The textInputHandler() method controls and manages the user input. The preventDefault() method is used to prevent Adobe Flash Player from immediately displaying the text in the input text field. The application is responsible for updating the field. To undo the user's deletion or modification to the characters already entered (the result string), the content of the input text field is reassigned to the result string when a user enters new characters. Also, to produce a consistent user experience, the setSelection() method places the insertion point (a caret) after the last selected character in the text field.

The first if statement in the textInputHandler() method checks the input for the second and fifth character positions of the combination key, which must be numbers. If the user input is correct, the updateCombination() method is called and the (result) combination key string is appended with the user input. The updateCombination() method also moves the insertion point after the selected character. After the seven characters are entered, the last if statement in the textInputHandler() method changes type of the inputTextField text field from INPUT to DYNAMIC, which means that the user can no longer enter or change any characters.

package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFieldAutoSize; import flash.events.TextEvent; public class TextEvent_TEXT_INPUTExample extends Sprite { private var instructionTextField:TextField = new TextField(); private var inputTextField:TextField = new TextField(); private var warningTextField:TextField = new TextField(); private var result:String = ""; public function TextEvent_TEXT_INPUTExample() { instructionTextField.x = 10; instructionTextField.y = 10; instructionTextField.background = true; instructionTextField.autoSize = TextFieldAutoSize.LEFT; instructionTextField.text = "Please enter a value in the format A#AA#AA,\n" + "where 'A' represents a letter and '#' represents a number.\n" + "(Note that once you input a character you can't change it.)" ; inputTextField.x = 10; inputTextField.y = 70; inputTextField.height = 20; inputTextField.width = 75; inputTextField.background = true; inputTextField.border = true; inputTextField.type = TextFieldType.INPUT; warningTextField.x = 10; warningTextField.y = 100; warningTextField.autoSize = TextFieldAutoSize.LEFT; inputTextField.addEventListener(TextEvent.TEXT_INPUT, textInputHandler); this.addChild(instructionTextField); this.addChild(inputTextField); this.addChild(warningTextField); } private function textInputHandler(event:TextEvent):void { var charExp:RegExp = /[a-zA-z]/; var numExp:RegExp = /[0-9]/; event.preventDefault(); inputTextField.text = result; inputTextField.setSelection(result.length + 1, result.length + 1); if (inputTextField.text.length == 1 || inputTextField.text.length == 4) { if(numExp.test(event.text) == true) { updateCombination(event.text); } else { warningTextField.text = "You need a single digit number."; } }else { if(charExp.test(event.text) == true) { updateCombination(event.text); } else { warningTextField.text = "You need an alphabet character."; } } if(inputTextField.text.length == 7) { inputTextField.type = TextFieldType.DYNAMIC; instructionTextField.text = "CONGRATULATIONS. You've done."; } } private function updateCombination(s:String):void { warningTextField.text = ""; result += s; inputTextField.text = result; inputTextField.setSelection(result.length + 1, result.length + 1); } } }
flash.text.TextField.textInputtext
text For a textInput event, the character or sequence of characters entered by the user.String For a textInput event, the character or sequence of characters entered by the user. For a link event, the text of the event attribute of the href attribute of the <a> tag. The following code shows that the link event is dispatched when a user clicks the hypertext link: import flash.text.TextField; import flash.events.TextEvent; var tf:TextField = new TextField(); tf.htmlText = "<a href='event:myEvent'>Click Me.</a>"; tf.addEventListener("link", clickHandler); addChild(tf); function clickHandler(e:TextEvent):void { trace(e.type); // link trace(e.text); // myEvent }
SampleDataEvent Dispatched when a Sound object requests new audio data or when a Microphone object has new audio data to provide.flash.events:Event Dispatched when a Sound object requests new audio data or when a Microphone object has new audio data to provide.

This event has two uses:

  • To provide dynamically generated audio data for a Sound object
  • To get audio data for a Microphone object

Dynamically generating audio using the Sound object Use the sampleData event to play dynamically generated audio. In this environment, the Sound object doesn't actually contain sound data. Instead, it acts as a socket for sound data that is being streamed to it through the use of the function you assign as the handler for the sampleData event.

In your function, you use the ByteArray.writeFloat() method to write to the event's data) property, which contains the sampled data you want to play.

If a Sound object has not loaded an MP3 file, when you call its play() method the object starts dispatching sampleData events, requesting sound samples. The Sound object continues to send events as the sound plays back until you stop providing data, or until the stop() method of the SoundChannel object is called.

Thes latency of the event varies from platform to platform, and it could change in future versions of Flash Player or AIR. Don't depend on a specific latency. Instead calculate it using ((SampleDataEvent.position/44.1) - SoundChannelObject.position).

Provide between 2048 and 8192 samples to the data property of the SampleDataEvent object. For best performance, provide as many samples as possible. The fewer samples you provide, the more likely it is that clicks and pops will occur during playback. This behavior can differ on various platforms and can occur in various situations - for example, when resizing the browser. You might write code that works on one platform when you provide only 2048 samples, but that same code might not work as well when run on a different platform. If you require the lowest latency possible, consider making the amount of data user-selectable.

If you provide fewer than 2048 samples, tha Sound object plays the remaining samples and then stops the sound as if the end of a sound file was reached, generating a complete event.

You can use the extract() method of a Sound object to extract its sound data, which you can then write to the dynamic stream for playback.

When you use the sampleData event with a Sound object, the only Sound methods that are enabled are extract() and play(). Calling any other methods or properties results in an "invalid call" exception. All methods and properties of the SoundChannel object are still enabled.

Capturing Microphone audio Use the sampleData event to capture audio data from a microphone. When you add an event listener for the sampleData event, the Microphone dispatches the event as audio samples become available.

In the event handler function, use the ByteArray.readFloat() method to read the event's data) property, which contains the sampled data. The event will contain multiple samples, so you should use a while loop to read the available data:

var soundBytes:ByteArray = new ByteArray(); while(event.data.bytesAvailable) { var sample:Number = event.data.readFloat(); soundBytes.writeFloat(sample); }
The following example plays a simple sine wave. var mySound:Sound = new Sound(); function sineWaveGenerator(event:SampleDataEvent):void { for ( var c:int=0; c<8192; c++ ) { event.data.writeFloat(Math.sin((Number(c+event.position)/Math.PI/2))*0.25); event.data.writeFloat(Math.sin((Number(c+event.position)/Math.PI/2))*0.25); } } mySound.addEventListener(SampleDataEvent.SAMPLE_DATA,sineWaveGenerator); mySound.play();
flash.media.SoundsampleDataflash.events:SampleDataEvent:SAMPLE_DATAflash.events:SampleDataEventflash.media.Sound.sampleDataflash.events.SampleDataEventSampleDataEvent Creates an event object that contains information about audio data events.typeString The type of the event. This value is:Event.SAMPLE_DATA. bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. thepositionNumber0The position of the data in the audio stream. thedataflash.utils:ByteArraynullA byte array of data. Creates an event object that contains information about audio data events. Event objects are passed as parameters to event listeners. clone Creates a copy of the SampleDataEvent object and sets each property's value to match that of the original.A new SampleDataEvent object with property values that match those of the original. flash.events:Event Creates a copy of the SampleDataEvent object and sets each property's value to match that of the original. toString Returns a string that contains all the properties of the SampleDataEvent object.A string that contains all the properties of the SampleDataEvent object. String Returns a string that contains all the properties of the SampleDataEvent object. The string is in the following format:

[SampleDataEvent type=value bubbles=value cancelable=value theposition=value thedata=value]

SAMPLE_DATA Defines the value of the type property of a SampleDataEvent event object.sampleDataString Defines the value of the type property of a SampleDataEvent event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.positionThe point from which audio data is provided.
flash.media.Sound.sampleDataflash.events.SampleDataEvent
data The data in the audio stream.flash.utils:ByteArray The data in the audio stream. position The position of the data in the audio stream.Number The position of the data in the audio stream.
HTTPStatusEvent The application dispatches HTTPStatusEvent objects when a network request returns an HTTP status code.flash.events:Event The application dispatches HTTPStatusEvent objects when a network request returns an HTTP status code.

HTTPStatusEvent objects are always sent before error or completion events. An HTTPStatusEvent object does not necessarily indicate an error condition; it simply reflects the HTTP status code (if any) that is provided by the networking stack. Some Flash Player environments may be unable to detect HTTP status codes; a status code of 0 is always reported in these cases.

In Flash Player, there is only one type of HTTPStatus event: httpStatus. In the AIR runtime, a FileReference, URLLoader, or URLStream can register to listen for an httpResponseStatus, which includes responseURL and responseHeaders properties. These properties are undefined in a httpStatus event.

The following example attempts to load a nonexistent file from the root web directory at http://www.[yourDomain].com, which should dispatch an httpStatusHandler event with a status of 404, indicating that the file was not found. The httpStatusHandler event is handled by httpStatusHandler(), which simply prints two lines of information about the event.

Notes:

  1. You need to compile the SWF file with "Local Playback Security" set to "Access Network Only" to generate a securityError event in this example.
  2. You need a server running on http://www.[yourDomain].com and listening on port 80 or you will receive an httpStatusHandler event with status code 0 instead of 404.
  3. You must not have a file named MissingFile.html at the root web directory of http://www.[yourDomain].com or you will not receive the correct httpStatusHandler event.

package { import flash.display.Sprite; import flash.net.URLLoader; import flash.net.URLRequest; import flash.events.HTTPStatusEvent; public class HTTPStatusEventExample extends Sprite { public function HTTPStatusEventExample() { var loader:URLLoader = new URLLoader(); loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler); var request:URLRequest = new URLRequest("http://www.[yourDomain].com/MissingFile.html"); loader.load(request); } private function httpStatusHandler(event:HTTPStatusEvent):void { trace("httpStatusHandler: " + event); trace("status: " + event.status); } } }
httpResponseStatusflash.events:HTTPStatusEvent:HTTP_RESPONSE_STATUSflash.events:HTTPStatusEventflash.net.URLStream.httpResponseStatusflash.net.FileReference.httpResponseStatushttpStatusflash.events:HTTPStatusEvent:HTTP_STATUSflash.events:HTTPStatusEventflash.display.LoaderInfo.httpStatusflash.net.FileReference.httpStatusflash.net.URLLoader.httpStatusflash.net.URLStream.httpStatusHTTPStatusEvent Creates an Event object that contains specific information about HTTP status events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of HTTPStatus event: HTTPStatusEvent.HTTP_STATUS. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. statusint0Numeric status. Event listeners can access this information through the status property. Constructor for HTTPStatusEvent objects. Creates an Event object that contains specific information about HTTP status events. Event objects are passed as parameters to event listeners. HTTP_STATUSclone Creates a copy of the HTTPStatusEvent object and sets the value of each property to match that of the original.A new HTTPStatusEvent object with property values that match those of the original. flash.events:Event Creates a copy of the HTTPStatusEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the HTTPStatusEvent object.A string that contains all the properties of the HTTPStatusEvent object. String Returns a string that contains all the properties of the HTTPStatusEvent object. The string is in the following format:

[HTTPStatusEvent type=value bubbles=value cancelable=value status=value]

HTTP_RESPONSE_STATUS Unlike the httpStatus event, the httpResponseStatus event is delivered before any response data.httpResponseStatusString Unlike the httpStatus event, the httpResponseStatus event is delivered before any response data. Also, the httpResponseStatus event includes values for the responseHeaders and responseURL properties (which are undefined for an httpStatus event. Note that the httpResponseStatus event (if any) will be sent before (and in addition to) any complete or error event.

The HTTPStatusEvent.HTTP_RESPONSE_STATUS constant defines the value of the type property of a httpResponseStatus event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.responseURLThe URL from which the response was returned.responseHeadersThe response headers that the response returned, as an array of URLRequestHeader objects.statusThe HTTP status code returned by the server.targetThe network object receiving an HTTP status code.
flash.net.URLStream.httpResponseStatusflash.net.FileReference.httpResponseStatus
HTTP_STATUS The HTTPStatusEvent.HTTP_STATUS constant defines the value of the type property of a httpStatus event object.httpStatusString The HTTPStatusEvent.HTTP_STATUS constant defines the value of the type property of a httpStatus event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.statusThe HTTP status code returned by the server.targetThe network object receiving an HTTP status code.
flash.display.LoaderInfo.httpStatusflash.net.FileReference.httpStatusflash.net.URLLoader.httpStatusflash.net.URLStream.httpStatus
responseHeaders The response headers that the response returned, as an array of URLRequestHeader objects.Array The response headers that the response returned, as an array of URLRequestHeader objects. flash.net.URLRequestHeaderresponseURL The URL that the response was returned from.String The URL that the response was returned from. In the case of redirects, this will be different from the request URL. status The HTTP status code returned by the server.int The HTTP status code returned by the server. For example, a value of 404 indicates that the server has not found a match for the requested URI. HTTP status codes can be found in sections 10.4 and 10.5 of the HTTP specification at http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.

If Flash Player or AIR cannot get a status code from the server, or if it cannot communicate with the server, the default value of 0 is passed to your code. A value of 0 can be generated in any player (for example, if a malformed URL is requested), and a value of 0 is always generated by the Flash Player plug-in when it is run in the following browsers, which do not pass HTTP status codes to the player: Netscape, Mozilla, Safari, Opera, and Internet Explorer for the Macintosh.

FileListEvent A File object dispatches a FileListEvent object when a call to the getDirectoryListingAsync() method of a File object successfully enumerates a set of files and directories or when a user selects files after a call to the browseForOpenMultiple() method.A File object dispatches a FileListEvent object after successful calls to the getDirectoryListingAsync() or browseForOpenMultiple() method. flash.events:Event A File object dispatches a FileListEvent object when a call to the getDirectoryListingAsync() method of a File object successfully enumerates a set of files and directories or when a user selects files after a call to the browseForOpenMultiple() method. File.getDirectoryListingAsync()directoryListingflash.events:FileListEvent:DIRECTORY_LISTINGflash.events:FileListEventselectMultipleflash.events:FileListEvent:SELECT_MULTIPLEflash.events:FileListEventFileListEvent The constructor function for a FileListEvent object.typeStringThe type of the event. bubblesBooleanfalseDetermines whether the event object bubbles (false for a FileListEvent object). cancelableBooleanfalseDetermines whether the Event object can be canceled (false for a FileListEvent object). filesArraynullAn array of File objects. The constructor function for a FileListEvent object.

The runtime uses this class to create FileListEvent objects. You will not use this constructor directly in your code.

DIRECTORY_LISTING The FileListEvent.DIRECTORY_LISTING constant defines the value of the type property of the event object for a directoryListing event.directoryListingString The FileListEvent.DIRECTORY_LISTING constant defines the value of the type property of the event object for a directoryListing event.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.filesAn array of File objects representing the files and directories found.targetThe FileListEvent object.
SELECT_MULTIPLE The FileListEvent.SELECT_MULTIPLE constant defines the value of the type property of the event object for a selectMultiple event.selectMultipleString The FileListEvent.SELECT_MULTIPLE constant defines the value of the type property of the event object for a selectMultiple event. PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.filesAn array of File objects representing the files selected.targetThe FileListEvent object. files An array of File objects representing the files and directories found or selected.Array An array of File objects representing the files and directories found or selected.

For the File.getDirectoryListingAsync() method, this is the list of files and directories found at the root level of the directory represented by the File object that called the method. For the File.browseForOpenMultiple() method, this is the list of files selected by the user.

NativeWindowBoundsEvent A NativeWindow object dispatches a NativeWindowBoundsEvent object when the size or location of the window changes.Event objects for NativeWindow events that change the size and/or location of the window. flash.events:Event A NativeWindow object dispatches a NativeWindowBoundsEvent object when the size or location of the window changes.

There are four types of events:

  • NativeWindowBoundsEvent.MOVING
  • NativeWindowBoundsEvent.MOVE
  • NativeWindowBoundsEvent.RESIZING
  • NativeWindowBoundsEvent.RESIZE
flash.events.NativeWindowBoundsEvent.MOVINGflash.events.NativeWindowBoundsEvent.MOVEflash.events.NativeWindowBoundsEvent.RESIZINGflash.events.NativeWindowBoundsEvent.RESIZEmoveflash.events:NativeWindowBoundsEvent:MOVEflash.events:NativeWindowBoundsEventDispatched by a NativeWindow object after it moves. flash.display.NativeWindowmovingflash.events:NativeWindowBoundsEvent:MOVINGflash.events:NativeWindowBoundsEventDispatched by a NativeWindow object before it moves. flash.display.NativeWindowresizeflash.events:NativeWindowBoundsEvent:RESIZEflash.events:NativeWindowBoundsEventDispatched by a NativeWindow object after it resizes. flash.display.NativeWindowresizingflash.events:NativeWindowBoundsEvent:RESIZINGflash.events:NativeWindowBoundsEventDispatched by a NativeWindow object before it resizes. flash.display.NativeWindowNativeWindowBoundsEvent Creates an Event object with specific information relevant to window bounds events.typeString The type of the event. Possible values are:
  • NativeWindowBoundsEvent.MOVING
  • NativeWindowBoundsEvent.MOVE
  • NativeWindowBoundsEvent.RESIZING
  • NativeWindowBoundsEvent.RESIZE
bubblesBooleanfalse Indicates whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseIndicates whether the Event object can be canceled. beforeBoundsflash.geom:RectanglenullIndicates the bounds before the most recent change or the pending change. afterBoundsflash.geom:RectanglenullIndicates the bounds after the most recent change or the pending change.
Creates an Event object with specific information relevant to window bounds events. Event objects are passed as parameters to event listeners.
clone Creates a copy of the NativeWindowBoundsEvent object and sets the value of each property to match that of the original.A new NativeWindowBoundsEvent object with property values that match those of the original. flash.events:Event Creates a copy of the NativeWindowBoundsEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the NativeWindowBoundsEvent object.A string that contains all the properties of the NativeWindowBoundsEvent object. String Returns a string that contains all the properties of the NativeWindowBoundsEvent object. The string has the following format:

[NativeWindowBoundsEvent type=value bubbles=value cancelable=value previousDisplayState=value currentDisplayState=value]

MOVE Defines the value of the type property of a move event object.moveStringDispatched by a NativeWindow object after it moves. Defines the value of the type property of a move event object.

This event has the following properties:

PropertiesValuesafterBoundsThe new bounds of the window.beforeBoundsThe old bounds of the window.targetThe NativeWindow object that has just changed state. bubblesNo.currentTargetIndicates the object that is actively processing the Event object with an event listener.cancelablefalse; There is no default behavior to cancel.
flash.display.NativeWindow
MOVING Defines the value of the type property of a moving event object.movingStringDispatched by a NativeWindow object before it moves. Defines the value of the type property of a moving event object.

This event has the following properties:

PropertiesValuesafterBoundsThe bounds of the window after the pending change.beforeBoundsThe bounds of the window before the pending change.bubblesNo.cancelabletrue; cancelling the event will prevent the window move.currentTargetIndicates the object that is actively processing the Event object with an event listener.targetThe NativeWindow object that has just changed state.

Note: On Linux, the preventDefault() method is not supported for this event.

flash.display.NativeWindow
RESIZE Defines the value of the type property of a resize event object.resizeStringDispatched by a NativeWindow object after it resizes. Defines the value of the type property of a resize event object.

This event has the following properties:

PropertiesValuesafterBoundsThe new bounds of the window.beforeBoundsThe old bounds of the window.targetThe NativeWindow object that has just changed state. bubblesNo.currentTargetIndicates the object that is actively processing the Event object with an event listener.cancelablefalse; There is no default behavior to cancel.
flash.display.NativeWindow
RESIZING Defines the value of the type property of a resizing event object.resizingStringDispatched by a NativeWindow object before it resizes. Defines the value of the type property of a resizing event object.

This event has the following properties:

PropertiesValuesafterBoundsThe bounds of the window after the pending change.beforeBoundsThe bounds of the window before the pending change.targetThe NativeWindow object that has just changed state. bubblesNo.currentTargetIndicates the object that is actively processing the Event object with an event listener.cancelabletrue; cancelling the event will prevent the window move.

Note: On Linux, the preventDefault() method is not supported for this event.

flash.display.NativeWindow
afterBounds The bounds of the window after the change.flash.geom:Rectangle The bounds of the window after the change.

If the event is moving or resizing, the bounds have not yet changed; afterBounds indicates the new bounds if the event is not canceled. If the event is move or resize, afterBounds indicates the new bounds.

beforeBounds The bounds of the window before the change.flash.geom:Rectangle The bounds of the window before the change.

If the event is moving or resizing, the bounds have not yet changed; beforeBounds reflects the current bounds. If the event is move or resize, beforeBounds indicates the original value.

SQLUpdateEvent A SQLUpdateEvent object is dispatched by a SQLConnection object when a data change occurs on any table associated with the SQLConnection instance.flash.events:Event A SQLUpdateEvent object is dispatched by a SQLConnection object when a data change occurs on any table associated with the SQLConnection instance. A data change can result from the execution of a SQL INSERT, UPDATE, or DELETE statement, either directly or as a result of a trigger that fires in connection with the statement execution. The following example shows the use of of a SQLUpdateEvent instance in responding to an update event. var dbStatement:SQLStatement; function initConnection():void { var dbFile:File = new File(File.separator + "employee.db"); db.addEventListener(SQLEvent.OPEN, dbOpenHandler); db.addEventListener(SQLUpdateEvent.UPDATE, dbUpdateHandler); dbStatement.text = "UPDATE employees SET name = :name WHERE id = :id"; dbStatement.parameters[:name] = "Bruce"; dbStatement.parameters[:id] = 100; dbStatement.sqlConnection = db; db.open(dbFile); } function dbUpdateHandler(event:SQLUpdateEvent):void { trace(event.type + " for table '" + event.table + "' was fired for row with ID:" + event.rowID); } function dbOpenHandler(event:SQLEvent):void { dbStatement.execute(); } flash.data.SQLConnectiondeleteflash.events:SQLUpdateEvent:DELETEflash.events:SQLUpdateEventinsertflash.events:SQLUpdateEvent:INSERTflash.events:SQLUpdateEventupdateflash.events:SQLUpdateEvent:UPDATEflash.events:SQLUpdateEventSQLUpdateEvent Creates a new SQLUpdateEvent instance.typeString The type of the event, available through the type property. bubblesBooleanfalse Determines whether the event object participates in the bubbling stage of the event flow. The default value is false. cancelableBooleanfalseDetermines whether the Event object can be cancelled. The default value is false. tableStringnullIndicates the name of the table whose data changed. rowIDNumber0The unique row identifier of the row that was inserted, deleted, or updated. Used to create new SQLUpdateEvent object. Creates a new SQLUpdateEvent instance. clone Creates a copy of the SQLUpdateEvent object and sets the value of each property to match that of the original.A new SQLUpdateEvent object with property values that match those of the original. flash.events:Event Creates a copy of the SQLUpdateEvent object and sets the value of each property to match that of the original. DELETE The SQLUpdateEvent.DELETE constant defines the value of the type property of a SQLConnection delete event.deleteString The SQLUpdateEvent.DELETE constant defines the value of the type property of a SQLConnection delete event. The delete event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.rowIDThe unique row identifier of the row that was inserted, deleted, or updated.targetThe SQLConnection object on which the operation was performed.tableThe name of the table on which the change occurred. INSERT The SQLUpdateEvent.INSERT constant defines the value of the type property of a SQLConnection insert event.insertString The SQLUpdateEvent.INSERT constant defines the value of the type property of a SQLConnection insert event. The insert event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.rowIDThe unique row identifier of the row that was inserted, deleted, or updated.targetThe SQLConnection object on which the operation was performed.tableThe name of the table on which the change occurred. UPDATE The SQLUpdateEvent.UPDATE constant defines the value of the type property of a SQLConnection update event.updateString The SQLUpdateEvent.UPDATE constant defines the value of the type property of a SQLConnection update event.

The update event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.rowIDThe unique row identifier of the row that was inserted, deleted, or updated.targetThe SQLConnection object on which the operation was performed.tableThe name of the table on which the change occurred.
rowID The unique row identifier of the row that was inserted, deleted, or updated.Number The unique row identifier of the row that was inserted, deleted, or updated.

A row identifier is used to uniquely identify a row in a table within the database. The value is frequently generated by the database.

The row identifier for a single SQL INSERT statement execution can be obtained through the lastInsertRowID property of the SQLResult object returned by the SQLStatement object's getResult() method (when called after the SQLStatement dispatches its result event).

For more information about primary keys and generated row identifiers, see the "CREATE TABLE" and "Expressions" sections in the appendix "SQL support in local databases."

flash.data.SQLConnection.lastInsertRowIDflash.data.SQLResult.lastInsertRowID
table The name of the table whose data change caused the event to be dispatched.String The name of the table whose data change caused the event to be dispatched.
EventDispatcher The EventDispatcher class is the base class for all runtime classes that dispatch events.flash.events:IEventDispatcherObject The EventDispatcher class is the base class for all classes that dispatch events. The EventDispatcher class implements the IEventDispatcher interface and is the base class for the DisplayObject class. The EventDispatcher class allows any object on the display list to be an event target and as such, to use the methods of the IEventDispatcher interface.

Event targets are an important part of the Flash® Player and Adobe® AIR® event model. The event target serves as the focal point for how events flow through the display list hierarchy. When an event such as a mouse click or a keypress occurs, Flash Player or the AIR application dispatches an event object into the event flow from the root of the display list. The event object then makes its way through the display list until it reaches the event target, at which point it begins its return trip through the display list. This round-trip journey to the event target is conceptually divided into three phases: the capture phase comprises the journey from the root to the last node before the event target's node, the target phase comprises only the event target node, and the bubbling phase comprises any subsequent nodes encountered on the return trip to the root of the display list.

In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already extending another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member, and write simple hooks to route calls into the aggregated EventDispatcher.

The following example uses the classes EventDispatcherExample and CustomDispatcher, a subclass of EventDispatcher, to show how a custom event is created and dispatched. The example carries out the following tasks:
  1. The constructor of EventDispatcherExample creates a local variable dispatcher and assigns it to a new CustomDispatcher instance.
  2. Inside CustomDispatcher, a string is set so that the event has the name action, and the doAction() method is declared. When called, this method creates the action event and dispatches it using EventDispatcher.dispatchEvent().
  3. The dispatcher property is then used to add the action event listener and associated subscriber method actionHandler(), which simply prints information about the event when it is dispatched.
  4. The doAction() method is invoked, dispatching the action event.
package { import flash.display.Sprite; import flash.events.Event; public class EventDispatcherExample extends Sprite { public function EventDispatcherExample() { var dispatcher:CustomDispatcher = new CustomDispatcher(); dispatcher.addEventListener(CustomDispatcher.ACTION, actionHandler); dispatcher.doAction(); } private function actionHandler(event:Event):void { trace("actionHandler: " + event); } } } import flash.events.EventDispatcher; import flash.events.Event; class CustomDispatcher extends EventDispatcher { public static var ACTION:String = "action"; public function doAction():void { dispatchEvent(new Event(CustomDispatcher.ACTION)); } }
deactivate [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.flash.events.Event.DEACTIVATEflash.events.Event [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. This event is a broadcast event, which means that it is dispatched by all EventDispatcher objects with a listener registered for this event. For more information about broadcast events, see the DisplayObject class. flash.display.DisplayObjectactivate [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.flash.events.Event.ACTIVATEflash.events.Event [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. This event is a broadcast event, which means that it is dispatched by all EventDispatcher objects with a listener registered for this event. For more information about broadcast events, see the DisplayObject class. flash.display.DisplayObjectEventDispatcher Aggregates an instance of the EventDispatcher class.targetflash.events:IEventDispatchernullThe target object for events dispatched to the EventDispatcher object. This parameter is used when the EventDispatcher instance is aggregated by a class that implements IEventDispatcher; it is necessary so that the containing object can be the target for events. Do not use this parameter in simple cases in which a class extends EventDispatcher. Aggregates an instance of the EventDispatcher class.

The EventDispatcher class is generally used as a base class, which means that most developers do not need to use this constructor function. However, advanced developers who are implementing the IEventDispatcher interface need to use this constructor. If you are unable to extend the EventDispatcher class and must instead implement the IEventDispatcher interface, use this constructor to aggregate an instance of the EventDispatcher class.

addEventListener Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.The listener specified is not a function. ArgumentErrorArgumentErrortypeStringThe type of event. listenerFunctionThe listener function that processes the event. This function must accept an Event object as its only parameter and must return nothing, as this example shows: function(evt:Event):void

The function can have any name.

useCaptureBooleanfalse Determines whether the listener works in the capture phase or the target and bubbling phases. If useCapture is set to true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture is false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call addEventListener twice, once with useCapture set to true, then again with useCapture set to false. priorityint0The priority level of the event listener. The priority is designated by a signed 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0. useWeakReferenceBooleanfalseDetermines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not.

Class-level member functions are not subject to garbage collection, so you can set useWeakReference to true for class-level member functions without subjecting them to garbage collection. If you set useWeakReference to true for a listener that is a nested inner function, the function will be garbage-collected and no longer persistent. If you create references to the inner function (save it in another variable) then it is not garbage-collected and stays persistent.

Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. You can register event listeners on all nodes in the display list for a specific type of event, phase, and priority.

After you successfully register an event listener, you cannot change its priority through additional calls to addEventListener(). To change a listener's priority, you must first call removeListener(). Then you can register the listener again with the new priority level.

Keep in mind that after the listener is registered, subsequent calls to addEventListener() with a different type or useCapture value result in the creation of a separate listener registration. For example, if you first register a listener with useCapture set to true, it listens only during the capture phase. If you call addEventListener() again using the same listener object, but with useCapture set to false, you have two separate listeners: one that listens during the capture phase and another that listens during the target and bubbling phases.

You cannot register an event listener for only the target phase or the bubbling phase. Those phases are coupled during registration because bubbling applies only to the ancestors of the target node.

If you no longer need an event listener, remove it by calling removeEventListener(), or memory problems could result. Event listeners are not automatically removed from memory because the garbage collector does not remove the listener as long as the dispatching object exists (unless the useWeakReference parameter is set to true).

Copying an EventDispatcher instance does not copy the event listeners attached to it. (If your newly created node needs an event listener, you must attach the listener after creating the node.) However, if you move an EventDispatcher instance, the event listeners attached to it move along with it.

If the event listener is being registered on a node while an event is being processed on this node, the event listener is not triggered during the current phase but can be triggered during a later phase in the event flow, such as the bubbling phase.

If an event listener is removed from a node while an event is being processed on the node, it is still triggered by the current actions. After it is removed, the event listener is never invoked again (unless registered again for future processing).

dispatchEvent Dispatches an event into the event flow.The event dispatch recursion limit has been reached. ErrorErrorA value of true if the event was successfully dispatched. A value of false indicates failure or that preventDefault() was called on the event. Booleaneventflash.events:EventThe Event object that is dispatched into the event flow. If the event is being redispatched, a clone of the event is created automatically. After an event is dispatched, its target property cannot be changed, so you must create a new copy of the event for redispatching to work. Dispatches an event into the event flow. The event target is the EventDispatcher object upon which the dispatchEvent() method is called. hasEventListener Checks whether the EventDispatcher object has any listeners registered for a specific type of event.A value of true if a listener of the specified type is registered; false otherwise. BooleantypeStringThe type of event. Checks whether the EventDispatcher object has any listeners registered for a specific type of event. This allows you to determine where an EventDispatcher object has altered handling of an event type in the event flow hierarchy. To determine whether a specific event type actually triggers an event listener, use willTrigger().

The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter.

When hasEventListener() is called from a LoaderInfo object, only the listeners that the caller can access are considered.

willTrigger()
removeEventListener Removes a listener from the EventDispatcher object.typeStringThe type of event. listenerFunctionThe listener object to remove. useCaptureBooleanfalse Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both, one call with useCapture() set to true, and another call with useCapture() set to false. Removes a listener from the EventDispatcher object. If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect. willTrigger Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.A value of true if a listener of the specified type will be triggered; false otherwise. BooleantypeStringThe type of event. Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. This method returns true if an event listener is triggered during any phase of the event flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants.

The difference between the hasEventListener() and the willTrigger() methods is that hasEventListener() examines only the object to which it belongs, whereas the willTrigger() method examines the entire event flow for the event specified by the type parameter.

When willTrigger() is called from a LoaderInfo object, only the listeners that the caller can access are considered.

TouchEvent The TouchEvent class lets you handle events on devices that detect user contact with the device (such as a finger on a touch screen).provides event handling support for touch interaction flash.events:Event The TouchEvent class lets you handle events on devices that detect user contact with the device (such as a finger on a touch screen). When a user interacts with a device such as a mobile phone or tablet with a touch screen, the user typically touches the screen with his or her fingers or a pointing device. You can develop applications that respond to basic touch events (such as a single finger tap) with the TouchEvent class. Create event listeners using the event types defined in this class. For user interaction with multiple points of contact (such as several fingers moving across a touch screen at the same time) use the related GestureEvent, PressAndTapGestureEvent, and TransformGestureEvent classes. And, use the properties and methods of these classes to construct event handlers that respond to the user touching the device.

Use the Multitouch class to determine the current environment's support for touch interaction, and to manage the support of touch interaction if the current environment supports it.

Note: When objects are nested on the display list, touch events target the deepest possible nested object that is visible in the display list. This object is called the target node. To have a target node's ancestor (an object containing the target node in the display list) receive notification of a touch event, use EventDispatcher.addEventListener() on the ancestor node with the type parameter set to the specific touch event you want to detect.

The following example shows event handling for the TOUCH_BEGIN, TOUCH_MOVE, and TOUCH_END events. While the point of contact moves across the screen (onTouchMove), the x-coordinate relative to the stage is traced to output. For the Sprite.startTouchDrag parameters in the onTouchBegin function, the value for touchPointID is the value assigned to the event object. The bounds parameter is the rectangle defining the boundaries of the parent display object (bg is a display object containing MySprite). Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; MySprite.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin); MySprite.addEventListener(TouchEvent.TOUCH_MOVE, onTouchMove); MySprite.addEventListener(TouchEvent.TOUCH_END, onTouchEnd); function onTouchBegin(eBegin:TouchEvent) { eBegin.target.startTouchDrag(eBegin.touchPointID, false, bg.getRect(this)); trace("touch begin"); } function onTouchMove(eMove:TouchEvent) { trace(eMove.stageX); } function onTouchEnd(eEnd:TouchEvent) { eEnd.target.stopTouchDrag(eEnd.touchPointID); trace("touch end"); } The following example shows how to handle touch events and touch event phases, as well as the Multitouch.maxTouchPoints and the touch event object's touchPointID properties. This example comes from Christian Cantrell, and is explained in more detail in his quickstart: Multi-touch and gesture support on the Flash Platform. package { import flash.display.Sprite; import flash.events.TouchEvent; import flash.text.AntiAliasType; import flash.text.TextField; import flash.text.TextFormat; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode; [SWF(width=320, height=460, frameRate=24, backgroundColor=0xEB7F00)] public class TouchExample2 extends Sprite { private var dots:Object; private var labels:Object; private var labelFormat:TextFormat; private var dotCount:uint; private var dotsLeft:TextField; private static const LABEL_SPACING:uint = 15; public function TouchExample2() { super(); this.labelFormat = new TextFormat(); labelFormat.color = 0xACF0F2; labelFormat.font = "Helvetica"; labelFormat.size = 11; this.dotCount = 0; this.dotsLeft = new TextField(); this.dotsLeft.width = 300; this.dotsLeft.defaultTextFormat = this.labelFormat; this.dotsLeft.x = 3; this.dotsLeft.y = 0; this.stage.addChild(this.dotsLeft); this.updateDotsLeft(); this.dots = new Object(); this.labels = new Object(); Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; this.stage.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin); this.stage.addEventListener(TouchEvent.TOUCH_MOVE, onTouchMove); this.stage.addEventListener(TouchEvent.TOUCH_END, onTouchEnd); } private function onTouchBegin(e:TouchEvent):void { if (this.dotCount == Multitouch.maxTouchPoints) return; var dot:Sprite = this.getCircle(); dot.x = e.stageX; dot.y = e.stageY; this.stage.addChild(dot); dot.startTouchDrag(e.touchPointID, true); this.dots[e.touchPointID] = dot; ++this.dotCount; var label:TextField = this.getLabel(e.stageX + ", " + e.stageY); label.x = 3; label.y = this.dotCount * LABEL_SPACING; this.stage.addChild(label); this.labels[e.touchPointID] = label; this.updateDotsLeft(); } private function onTouchMove(e:TouchEvent):void { var label:TextField = this.labels[e.touchPointID]; label.text = (e.stageX + ", " + e.stageY); } private function onTouchEnd(e:TouchEvent):void { var dot:Sprite = this.dots[e.touchPointID]; var label:TextField = this.labels[e.touchPointID]; this.stage.removeChild(dot); this.stage.removeChild(label); delete this.dots[e.touchPointID]; delete this.labels[e.touchPointID]; --this.dotCount; this.updateDotsLeft(); } private function getCircle(circumference:uint = 40):Sprite { var circle:Sprite = new Sprite(); circle.graphics.beginFill(0x1695A3); circle.graphics.drawCircle(0, 0, circumference); return circle; } private function getLabel(initialText:String):TextField { var label:TextField = new TextField(); label.defaultTextFormat = this.labelFormat; label.selectable = false; label.antiAliasType = AntiAliasType.ADVANCED; label.text = initialText; return label; } private function updateDotsLeft():void { this.dotsLeft.text = "Touches Remaining: " + (Multitouch.maxTouchPoints - this.dotCount); } } }
flash.ui.Multitouchflash.events.GestureEventflash.events.TransformGestureEventflash.events.PressAndTapGestureEventflash.events.MouseEventflash.events.EventDispatcher.addEventListener()touchBeginflash.events:TouchEvent:TOUCH_BEGINflash.events:TouchEventflash.display.InteractiveObject.touchBegintouchEndflash.events:TouchEvent:TOUCH_ENDflash.events:TouchEventflash.display.InteractiveObject.touchEndtouchMoveflash.events:TouchEvent:TOUCH_MOVEflash.events:TouchEventflash.display.InteractiveObject.touchMovetouchOutflash.events:TouchEvent:TOUCH_OUTflash.events:TouchEventflash.display.InteractiveObject.touchOuttouchOverflash.events:TouchEvent:TOUCH_OVERflash.events:TouchEventflash.display.InteractiveObject.touchOvertouchRollOutflash.events:TouchEvent:TOUCH_ROLL_OUTflash.events:TouchEventflash.display.InteractiveObject.touchRollOuttouchRollOverflash.events:TouchEvent:TOUCH_ROLL_OVERflash.events:TouchEventflash.display.InteractiveObject.touchRollOvertouchTapflash.events:TouchEvent:TOUCH_TAPflash.events:TouchEvent The following example displays a message when the square drawn on mySprite is tapped on a touch-enabled screen: Multitouch.inputMode=MultitouchInputMode.TOUCH_POINT; var mySprite:Sprite = new Sprite(); var myTextField:TextField = new TextField(); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0,0,40,40); addChild(mySprite); mySprite.addEventListener(TouchEvent.TOUCH_TAP, taphandler); function taphandler(e:TouchEvent): void { myTextField.text = "I've been tapped"; myTextField.y = 50; addChild(myTextField); } flash.display.InteractiveObject.touchTapTouchEvent Creates an Event object that contains information about touch events.typeString The type of the event. Possible values are: TouchEvent.TOUCH_BEGIN, TouchEvent.TOUCH_END, TouchEvent.TOUCH_MOVE, TouchEvent.TOUCH_OUT, TouchEvent.TOUCH_OVER, TouchEvent.TOUCH_ROLL_OUT, TouchEvent.TOUCH_ROLL_OVER, and TouchEvent.TOUCH_TAP. bubblesBooleantrue Determines whether the Event object participates in the bubbling phase of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. touchPointIDint0A unique identification number (as an int) assigned to the touch point. isPrimaryTouchPointBooleanfalseIndicates whether the first point of contact is mapped to mouse events. localXNumberunknownThe horizontal coordinate at which the event occurred relative to the containing sprite. localYNumberunknownThe vertical coordinate at which the event occurred relative to the containing sprite. sizeXNumberunknownWidth of the contact area. sizeYNumberunknownHeight of the contact area. pressureNumberunknownA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0. relatedObjectflash.display:InteractiveObjectnullThe complementary InteractiveObject instance that is affected by the event. For example, when a touchOut event occurs, relatedObject represents the display list object to which the pointing device now points. ctrlKeyBooleanfalseOn Windows or Linux, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. altKeyBooleanfalseIndicates whether the Alt key is activated (Windows or Linux only). shiftKeyBooleanfalseIndicates whether the Shift key is activated. commandKeyBooleanfalse(AIR only) Indicates whether the Command key is activated (Mac only). This parameter is for Adobe AIR only; do not set it for Flash Player content. controlKeyBooleanfalse(AIR only) Indicates whether the Control or Ctrl key is activated. This parameter is for Adobe AIR only; do not set it for Flash Player content. Constructor for TouchEvent objects. Creates an Event object that contains information about touch events. Event objects are passed as parameters to event listeners. clone Creates a copy of the TouchEvent object and sets the value of each property to match that of the original.A new TouchEvent object with property values that match those of the original. flash.events:Event Creates a copy of the TouchEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the TouchEvent object.A string that contains all the properties of the TouchEvent object. String Returns a string that contains all the properties of the TouchEvent object. The string is in the following format:

[TouchEvent type=value bubbles=value cancelable=value ... ]

updateAfterEvent Instructs Flash Player or Adobe AIR to render after processing of this event completes, if the display list has been modified. Instructs Flash Player or Adobe AIR to render after processing of this event completes, if the display list has been modified. TOUCH_BEGIN Defines the value of the type property of a TOUCH_BEGIN touch event object.touchBeginString Defines the value of the type property of a TOUCH_BEGIN touch event object.

The dispatched TouchEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase in the event flow.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.pressureA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.relatedObjectA reference to a display list object related to the event.shiftKeytrue if the Shift key is active; false if it is inactive.sizeXWidth of the contact area.sizeYHeight of the contact area.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the touching device. 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.touchPointIDA unique identification number (as an int) assigned to the touch point.
flash.display.InteractiveObject.touchBegin
TOUCH_END Defines the value of the type property of a TOUCH_END touch event object.touchEndString Defines the value of the type property of a TOUCH_END touch event object.

The dispatched TouchEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase in the event flow.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.pressureA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.relatedObjectA reference to a display list object related to the event.shiftKeytrue if the Shift key is active; false if it is inactive.sizeXWidth of the contact area.sizeYHeight of the contact area.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the touching device. 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.touchPointIDA unique identification number (as an int) assigned to the touch point.
flash.display.InteractiveObject.touchEnd
TOUCH_MOVE Defines the value of the type property of a TOUCH_MOVE touch event object.touchMoveString Defines the value of the type property of a TOUCH_MOVE touch event object.

The dispatched TouchEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase in the event flow.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.pressureA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.relatedObjectA reference to a display list object related to the event.shiftKeytrue if the Shift key is active; false if it is inactive.sizeXWidth of the contact area.sizeYHeight of the contact area.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the touching device. 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.touchPointIDA unique identification number (as an int) assigned to the touch point.
flash.display.InteractiveObject.touchMove
TOUCH_OUT Defines the value of the type property of a TOUCH_OUT touch event object.touchOutString Defines the value of the type property of a TOUCH_OUT touch event object.

The dispatched TouchEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase in the event flow.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.pressureA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.relatedObjectA reference to a display list object related to the event.shiftKeytrue if the Shift key is active; false if it is inactive.sizeXWidth of the contact area.sizeYHeight of the contact area.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the touching device. 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.touchPointIDA unique identification number (as an int) assigned to the touch point.
flash.display.InteractiveObject.touchOut
TOUCH_OVER Defines the value of the type property of a TOUCH_OVER touch event object.touchOverString Defines the value of the type property of a TOUCH_OVER touch event object.

The dispatched TouchEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase in the event flow.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.pressureA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.relatedObjectA reference to a display list object related to the event.shiftKeytrue if the Shift key is active; false if it is inactive.sizeXWidth of the contact area.sizeYHeight of the contact area.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the touching device. 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.touchPointIDA unique identification number (as an int) assigned to the touch point.
flash.display.InteractiveObject.touchOver
TOUCH_ROLL_OUT Defines the value of the type property of a TOUCH_ROLL_OUT touch event object.touchRollOutString Defines the value of the type property of a TOUCH_ROLL_OUT touch event object.

The dispatched TouchEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase in the event flow.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.pressureA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.relatedObjectA reference to a display list object related to the event.shiftKeytrue if the Shift key is active; false if it is inactive.sizeXWidth of the contact area.sizeYHeight of the contact area.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the touching device. 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.touchPointIDA unique identification number (as an int) assigned to the touch point.
flash.display.InteractiveObject.touchRollOut
TOUCH_ROLL_OVER Defines the value of the type property of a TOUCH_ROLL_OVER touch event object.touchRollOverString Defines the value of the type property of a TOUCH_ROLL_OVER touch event object.

The dispatched TouchEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase in the event flow.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.pressureA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.relatedObjectA reference to a display list object related to the event.shiftKeytrue if the Shift key is active; false if it is inactive.sizeXWidth of the contact area.sizeYHeight of the contact area.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the touching device. 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.touchPointIDA unique identification number (as an int) assigned to the touch point.
flash.display.InteractiveObject.touchRollOver
TOUCH_TAP Defines the value of the type property of a TOUCH_TAP touch event object.touchTapString Defines the value of the type property of a TOUCH_TAP touch event object.

The dispatched TouchEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.eventPhaseThe current phase in the event flow.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.pressureA value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.relatedObjectA reference to a display list object related to the event.shiftKeytrue if the Shift key is active; false if it is inactive.sizeXWidth of the contact area.sizeYHeight of the contact area.stageXThe horizontal coordinate at which the event occurred in global stage coordinates.stageYThe vertical coordinate at which the event occurred in global stage coordinates.targetThe InteractiveObject instance under the touching device. 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.touchPointIDA unique identification number (as an int) assigned to the touch point.
The following example displays a message when the square drawn on mySprite is tapped on a touch-enabled screen: Multitouch.inputMode=MultitouchInputMode.TOUCH_POINT; var mySprite:Sprite = new Sprite(); var myTextField:TextField = new TextField(); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0,0,40,40); addChild(mySprite); mySprite.addEventListener(TouchEvent.TOUCH_TAP, taphandler); function taphandler(e:TouchEvent): void { myTextField.text = "I've been tapped"; myTextField.y = 50; addChild(myTextField); }
flash.display.InteractiveObject.touchTap
altKey Indicates whether the Alt key is active (true) or inactive (false).Boolean Indicates whether the Alt key is active (true) or inactive (false). Supported for Windows and Linux operating systems only. commandKey Indicates whether the command key is activated (Mac only).Boolean Indicates whether the command key is activated (Mac only).

On a Mac OS, the value of the commandKey property is the same value as the ctrlKey property. This property is always false on Windows or Linux.

controlKey Indicates whether the Control key is activated on Mac and whether the Ctrl key is activated on Windows or Linux.Boolean Indicates whether the Control key is activated on Mac and whether the Ctrl key is activated on Windows or Linux. ctrlKey On Windows or Linux, indicates whether the Ctrl key is active (true) or inactive (false).Boolean On Windows or Linux, indicates whether the Ctrl key is active (true) or inactive (false). On Macintosh, indicates whether either the Control key or the Command key is activated. isPrimaryTouchPoint Indicates whether the first point of contact is mapped to mouse events.Boolean Indicates whether the first point of contact is mapped to mouse events. flash.events.MouseEventisRelatedObjectInaccessible If true, the relatedObject property is set to null for reasons related to security sandboxes.Boolean If true, the relatedObject property is set to null for reasons related to security sandboxes. If the nominal value of relatedObject is a reference to a DisplayObject in another sandbox, relatedObject is set to null unless there is permission in both directions across this sandbox boundary. Permission is established by calling Security.allowDomain() from a SWF file, or by providing a policy file from the server of an image file, and setting the LoaderContext.checkPolicyFile property when loading the image. MouseEvent.relatedObjectSecurity.allowDomain()LoaderContext.checkPolicyFilelocalX The horizontal coordinate at which the event occurred relative to the containing sprite.Number The horizontal coordinate at which the event occurred relative to the containing sprite. localY The vertical coordinate at which the event occurred relative to the containing sprite.Number The vertical coordinate at which the event occurred relative to the containing sprite. pressure A value between 0.0 and 1.0 indicating force of the contact with the device.Number A value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0. relatedObject A reference to a display list object that is related to the event.flash.display:InteractiveObject A reference to a display list object that is related to the event. For example, when a touchOut event occurs, relatedObject represents the display list object to which the pointing device now points. This property applies to the touchOut, touchOver, touchRollOut, and touchRollOver events.

The value of this property can be null in two circumstances: if there is no related object, or there is a related object, but it is in a security sandbox to which you don't have access. Use the isRelatedObjectInaccessible() property to determine which of these reasons applies.

TouchEvent.isRelatedObjectInaccessible
shiftKey Indicates whether the Shift key is active (true) or inactive (false).Boolean Indicates whether the Shift key is active (true) or inactive (false). sizeX Width of the contact area.Number Width of the contact area. sizeY Height of the contact area.Number Height of the contact area. stageX The horizontal coordinate at which the event occurred in global Stage coordinates.Number The horizontal coordinate at which the event occurred in global Stage coordinates. This property is calculated when the localX property is set. stageY The vertical coordinate at which the event occurred in global Stage coordinates.Number The vertical coordinate at which the event occurred in global Stage coordinates. This property is calculated when the localY property is set. touchPointID A unique identification number (as an int) assigned to the touch point.int A unique identification number (as an int) assigned to the touch point. The following example establishes a variable touchMoveID to test for the correct touchPointID value before responding to a touch move event. Otherwise, other touch input triggers the event handler, too. Notice the listeners for the move and end phases are on the stage, not the display object. The stage listens for the move or end phases in case the user's touch moves beyond the display object boundaries. Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; var mySprite:Sprite = new Sprite(); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0,0,40,40); addChild(mySprite); var myTextField:TextField = new TextField(); addChild(myTextField); myTextField.width = 200; myTextField.height = 20; var touchMoveID:int = 0; mySprite.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchBegin); function onTouchBegin(event:TouchEvent) { if(touchMoveID != 0) { myTextField.text = "already moving. ignoring new touch"; return; } touchMoveID = event.touchPointID; myTextField.text = "touch begin" + event.touchPointID; stage.addEventListener(TouchEvent.TOUCH_MOVE, onTouchMove); stage.addEventListener(TouchEvent.TOUCH_END, onTouchEnd); } function onTouchMove(event:TouchEvent) { if(event.touchPointID != touchMoveID) { myTextField.text = "ignoring unrelated touch"; return; } mySprite.x = event.stageX; mySprite.y = event.stageY; myTextField.text = "touch move" + event.touchPointID; } function onTouchEnd(event:TouchEvent) { if(event.touchPointID != touchMoveID) { myTextField.text = "ignoring unrelated touch end"; return; } touchMoveID = 0; stage.removeEventListener(TouchEvent.TOUCH_MOVE, onTouchMove); stage.removeEventListener(TouchEvent.TOUCH_END, onTouchEnd); myTextField.text = "touch end" + event.touchPointID; }
ServerSocketConnectEvent A ServerSocket object dispatches a ServerSocketConnectEvent object when a client attempts to connect to the server socket.flash.events:Event A ServerSocket object dispatches a ServerSocketConnectEvent object when a client attempts to connect to the server socket.

The socket property of the ServerSocketConnectEvent object provides the Socket object to use for subsequent communication between the server and the client. To deny the connection, call the Socket close() method.

ServerSocket classServerSocketConnectEvent Creates a ServerSocketConnectEvent object that contains information about a client connection.typeString The type of the event. Must be: ServerSocketConnectEvent.CONNECT. bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. Always false cancelableBooleanfalseDetermines whether the Event object can be canceled. Always false. socketflash.net:SocketnullThe socket for the new connection. Creates a ServerSocketConnectEvent object that contains information about a client connection. clone Creates a copy of the ServerSocketConnectEvent object and sets each property's value to match that of the original.A new ServerSocketConnectEvent object with property values that match those of the original. flash.events:Event Creates a copy of the ServerSocketConnectEvent object and sets each property's value to match that of the original. toString Returns a string that contains all the properties of the ServerSocketConnectEvent object.A string that contains all the properties of the ServerSocketConnectEvent object. String Returns a string that contains all the properties of the ServerSocketConnectEvent object.

The string is in the following format:

[ServerSocketConnectEvent type=value bubbles=value cancelable=value socket=value]

CONNECT Defines the value of the type property of a ServerSocketConnectEvent event object.connectStringDispatched by a ServerSocket object when a client connection is received. Defines the value of the type property of a ServerSocketConnectEvent event object.

This event has the following properties:

PropertyValuebubblesfalse.cancelablefalse, there is no default behavior to cancel.currentTargetThis ServerSocket object.targetThis ServerSocket object.socketThe Socket object representing the new connection.
socket The socket for the new connection.flash.net:Socket The socket for the new connection.

Use this Socket object for all communication with the client. Your application is responsible for maintaining a reference to the Socket object. If you don't, the object is eligible for garbage collection and may be destroyed by the runtime without warning.

SyncEvent An SharedObject object representing a remote shared object dispatches a SyncEvent object when the remote shared object has been updated by the server.Event objects for SyncEvent events. flash.events:Event An SharedObject object representing a remote shared object dispatches a SyncEvent object when the remote shared object has been updated by the server. There is only one type of sync event: SyncEvent.SYNC. SharedObject classsyncflash.events:SyncEvent:SYNCflash.events:SyncEventflash.net.SharedObject.syncSyncEvent Creates an Event object that contains information about sync events.typeStringThe type of the event. Event listeners can access this information through the inherited type property. There is only one type of sync event: SyncEvent.SYNC. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. changeListArraynullAn array of objects that describe the synchronization with the remote SharedObject. Event listeners can access this object through the changeList property. Constructor for SyncEvent objects. Creates an Event object that contains information about sync events. Event objects are passed as parameters to event listeners. changeListclone Creates a copy of the SyncEvent object and sets the value of each property to match that of the original.A new SyncEvent object with property values that match those of the original. flash.events:Event Creates a copy of the SyncEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the SyncEvent object.A string that contains all the properties of the SyncEvent object. String Returns a string that contains all the properties of the SyncEvent object. The string is in the following format:

[SyncEvent type=value bubbles=value cancelable=value list=value]

SYNC Defines the value of the type property of a sync event object.syncString Defines the value of the type property of a sync event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.changeListAn array with properties that describe the array's status.targetThe SharedObject instance that has been updated by the server.
flash.net.SharedObject.sync
changeList An array of objects; each object contains properties that describe the changed members of a remote shared object.Array An array of objects; each object contains properties that describe the changed members of a remote shared object. The properties of each object are code, name, and oldValue.

When you initially connect to a remote shared object that is persistent locally and/or on the server, all the properties of this object are set to empty strings.

Otherwise, Flash sets code to "clear", "success", "reject", "change", or "delete".

  • A value of "clear" means either that you have successfully connected to a remote shared object that is not persistent on the server or the client, or that all the properties of the object have been deleted--for example, when the client and server copies of the object are so far out of sync that Flash Player resynchronizes the client object with the server object. In the latter case, SyncEvent.SYNC is dispatched and the "code" value is set to "change".
  • A value of "success" means the client changed the shared object.
  • A value of "reject" means the client tried unsuccessfully to change the object; instead, another client changed the object.
  • A value of "change" means another client changed the object or the server resynchronized the object.
  • A value of "delete" means the attribute was deleted.

The name property contains the name of the property that has been changed.

The oldValue property contains the former value of the changed property. This parameter is null unless code has a value of "reject" or "change".

NetConnection classNetStream class
KeyboardEvent A KeyboardEvent object id dispatched in response to user input through a keyboard.Event objects for Keyboard events. flash.events:Event A KeyboardEvent object id dispatched in response to user input through a keyboard. There are two types of keyboard events: KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP

Because mappings between keys and specific characters vary by device and operating system, use the TextEvent event type for processing character input.

To listen globally for key events, listen on the Stage for the capture and target or bubble phase.

The following example uses the KeyboardEventExample class to show keyboard events and their listener functions. The example carries out the following tasks:
  1. It creates a new Sprite instance named child.
  2. It declares properties for later use in setting a square's background color and size.
  3. Using methods of Sprite, it draws a light-blue square that it displays on the Stage at default coordinates (0,0) by calling the addChild() method.
  4. It adds one mouse event and two keyboard type event listeners:
    • click/clickHandler which is dispatched when you click on the square to set focus on the child sprite so it can listen for keyboard events.
    • keyDown/keyDownHandler which is dispatched whenever any key is pressed. The subscriber method prints information about the event using the trace() statement.
    • keyUp/keyUpHandler which is dispatched when a key is released.

When you test this example, you need to click the square first for the keyboard events to work.

Also, if you are using the Test Movie command in Flash, the authoring interface may respond to certain keys instead of the event listeners attached to the child sprite.

package { import flash.display.Sprite; import flash.display.DisplayObject; import flash.events.*; public class KeyboardEventExample extends Sprite { private var child:Sprite = new Sprite(); private var bgColor:uint = 0x00CCFF; private var size:uint = 80; public function KeyboardEventExample() { child.graphics.beginFill(bgColor); child.graphics.drawRect(0, 0, size, size); child.graphics.endFill(); addChild(child); child.addEventListener(MouseEvent.CLICK, clickHandler); child.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); child.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler); } private function clickHandler(event:MouseEvent):void { stage.focus = child; } private function keyDownHandler(event:KeyboardEvent):void { trace("keyDownHandler: " + event.keyCode); trace("ctrlKey: " + event.ctrlKey); trace("keyLocation: " + event.keyLocation); trace("shiftKey: " + event.shiftKey); trace("altKey: " + event.altKey); } private function keyUpHandler(event:KeyboardEvent):void { trace("keyUpHandler: " + event.keyCode); } } }
KEY_DOWNKEY_UPKeyLocationkeyDownflash.events:KeyboardEvent:KEY_DOWNflash.events:KeyboardEventflash.display.InteractiveObject.keyDownkeyUpflash.events:KeyboardEvent:KEY_UPflash.events:KeyboardEventflash.display.InteractiveObject.keyUpKeyboardEvent Creates an Event object that contains specific information about keyboard events.typeString The type of the event. Possible values are: KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP bubblesBooleantrueDetermines whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. charCodeValueuint0The character code value of the key pressed or released. The character code values returned are English keyboard values. For example, if you press Shift+3, the Keyboard.charCode() property returns # on a Japanese keyboard, just as it does on an English keyboard. keyCodeValueuint0The key code value of the key pressed or released. keyLocationValueuint0The location of the key on the keyboard. ctrlKeyValueBooleanfalseOn Windows, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. altKeyValueBooleanfalseIndicates whether the Alt key modifier is activated (Windows only). shiftKeyValueBooleanfalseIndicates whether the Shift key modifier is activated. controlKeyValueBooleanfalseIndicates whether the Control key is activated on Mac, and whether the Control or Ctrl keys are activated on WIndows and Linux. commandKeyValueBooleanfalseIndicates whether the Command key is activated (Mac only). Constructor for KeyboardEvent objects. Creates an Event object that contains specific information about keyboard events. Event objects are passed as parameters to event listeners. KEY_DOWNKEY_UPKeyboard.charCodeclone Creates a copy of the KeyboardEvent object and sets the value of each property to match that of the original.A new KeyboardEvent object with property values that match those of the original. flash.events:Event Creates a copy of the KeyboardEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the KeyboardEvent object.A string that contains all the properties of the KeyboardEvent object. String Returns a string that contains all the properties of the KeyboardEvent object. The string is in the following format:

[KeyboardEvent type=value bubbles=value cancelable=value ... shiftKey=value]

updateAfterEvent Indicates that the display should be rendered after processing of this event completes, if the display list has been modified Indicates that the display should be rendered after processing of this event completes, if the display list has been modified KEY_DOWN The KeyboardEvent.KEY_DOWN constant defines the value of the type property of a keyDown event object.keyDownString The KeyboardEvent.KEY_DOWN constant defines the value of the type property of a keyDown event object.

This event has the following properties:

PropertyValuebubblestruecancelabletrue in AIR, false in Flash Player; in AIR, canceling this event prevents the character from being entered into a text field.charCodeThe character code value of the key pressed or released.commandKeytrue on Mac if the Command key is active. Otherwise, falsecontrolKeytrue on Windows and Linux if the Ctrl key is active. true on Mac if either the Control key is active. Otherwise, falsectrlKeytrue on Windows and Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.keyCodeThe key code value of the key pressed or released.keyLocationThe location of the key on the keyboard.shiftKeytrue if the Shift key is active; false if it is inactive.targetThe InteractiveObject instance with focus. 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.
flash.display.InteractiveObject.keyDown
KEY_UP The KeyboardEvent.KEY_UP constant defines the value of the type property of a keyUp event object.keyUpString The KeyboardEvent.KEY_UP constant defines the value of the type property of a keyUp event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.charCodeContains the character code value of the key pressed or released.commandKeytrue on Mac if the Command key is active. Otherwise, falsecontrolKeytrue on Windows and Linux if the Ctrl key is active. true on Mac if either the Control key is active. Otherwise, falsectrlKeytrue on Windows if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.keyCodeThe key code value of the key pressed or released.keyLocationThe location of the key on the keyboard.shiftKeytrue if the Shift key is active; false if it is inactive.targetThe InteractiveObject instance with focus. 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.
flash.display.InteractiveObject.keyUp
altKey Indicates whether the Alt key is active (true) or inactive (false) on Windows; indicates whether the Option key is active on Mac OS.Boolean Indicates whether the Alt key is active (true) or inactive (false) on Windows; indicates whether the Option key is active on Mac OS. charCode Contains the character code value of the key pressed or released.uint Contains the character code value of the key pressed or released. The character code values are English keyboard values. For example, if you press Shift+3, charCode is # on a Japanese keyboard, just as it is on an English keyboard.

Note: When an input method editor (IME) is running, charCode does not report accurate character codes.

flash.system.IME
commandKey Indicates whether the Command key is active (true) or inactive (false).Boolean Indicates whether the Command key is active (true) or inactive (false). Supported for Mac OS only. On Mac OS, the commandKey property has the same value as the ctrlKey property. controlKey Indicates whether the Control key is active (true) or inactive (false).Boolean Indicates whether the Control key is active (true) or inactive (false). On Windows and Linux, this is also true when the Ctrl key is active. ctrlKey On Windows and Linux, indicates whether the Ctrl key is active (true) or inactive (false); On Mac OS, indicates whether either the Ctrl key or the Command key is active.Boolean On Windows and Linux, indicates whether the Ctrl key is active (true) or inactive (false); On Mac OS, indicates whether either the Ctrl key or the Command key is active. keyCode The key code value of the key pressed or released.uint The key code value of the key pressed or released.

Note: When an input method editor (IME) is running, keyCode does not report accurate key codes.

flash.system.IME
keyLocation Indicates the location of the key on the keyboard.uint Indicates the location of the key on the keyboard. This is useful for differentiating keys that appear more than once on a keyboard. For example, you can differentiate between the left and right Shift keys by the value of this property: KeyLocation.LEFT for the left and KeyLocation.RIGHT for the right. Another example is differentiating between number keys pressed on the standard keyboard (KeyLocation.STANDARD) versus the numeric keypad (KeyLocation.NUM_PAD). shiftKey Indicates whether the Shift key modifier is active (true) or inactive (false).Boolean Indicates whether the Shift key modifier is active (true) or inactive (false).
NativeWindowDisplayStateEvent A NativeWindow object dispatches events of the NativeWindowDisplayStateEvent class when the window display state changes.Event objects for NativeWindow events that change the display state of the window. flash.events:Event A NativeWindow object dispatches events of the NativeWindowDisplayStateEvent class when the window display state changes. There are two types of events:
  • NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING
  • NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE
flash.events.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGINGflash.events.NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGEdisplayStateChangeflash.events:NativeWindowDisplayStateEvent:DISPLAY_STATE_CHANGEflash.events:NativeWindowDisplayStateEventDispatched by a NativeWindow object after the display state changes. flash.display.NativeWindowdisplayStateChangingflash.events:NativeWindowDisplayStateEvent:DISPLAY_STATE_CHANGINGflash.events:NativeWindowDisplayStateEventDispatched by a NativeWindow object before the display state changes. flash.display.NativeWindowNativeWindowDisplayStateEvent Creates an Event object with specific information relevant to window display state events.typeString The type of the event. Possible values are:
  • NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING
  • NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE
bubblesBooleantrue Determines whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseDetermines whether the Event object can be cancelled. beforeDisplayStateStringThe displayState before the change. afterDisplayStateStringThe displayState after the change.
Creates an Event object with specific information relevant to window display state events. Event objects are passed as parameters to event listeners.
clone Creates a copy of the NativeWindowDisplayStateEvent object and sets the value of each property to match that of the original.A new NativeWindowDisplayStateEvent object with property values that match those of the original. flash.events:Event Creates a copy of the NativeWindowDisplayStateEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the NativeWindowDisplayStateEvent object.A string that contains all the properties of the NativeWindowDisplayStateEvent object. String Returns a string that contains all the properties of the NativeWindowDisplayStateEvent object. The string has the following format:

[NativeWindowDisplayStateEvent type=value bubbles=value cancelable=value beforeDisplayState=value afterDisplayState=value]

DISPLAY_STATE_CHANGE Defines the value of the type property of a displayStateChange event object.displayStateChangeStringDispatched by a NativeWindow object after the display state changes. Defines the value of the type property of a displayStateChange event object.

This event has the following properties:

PropertiesValuesafterDisplayStateThe old display state of the window.beforeDisplayStateThe new display state of the window.targetThe NativeWindow instance that has just changed state. bubblesNo.currentTargetIndicates the object that is actively processing the Event object with an event listener.cancelablefalse; There is no default behavior to cancel.
flash.display.NativeWindow
DISPLAY_STATE_CHANGING Defines the value of the type property of a displayStateChanging event object.displayStateChangingStringDispatched by a NativeWindow object before the display state changes. Defines the value of the type property of a displayStateChanging event object.

This event has the following properties:

PropertiesValuesafterDisplayStateThe display state of the window before the pending change.beforeDisplayStateThe display state of the window after the pending change.targetThe NativeWindow instance that has just changed state. bubblesNo.currentTargetIndicates the object that is actively processing the Event object with an event listener.cancelabletrue; canceling the event will prevent the change.
flash.display.NativeWindow
afterDisplayState The display state of the NativeWindow after the change.String The display state of the NativeWindow after the change.

If the event is displayStateChanging, the display state has not yet changed; afterDisplayState indicates the new display state if the event is not canceled. If the event is displayStateChanged, afterDisplayState indicates the current value.

beforeDisplayState The display state of the NativeWindow before the change.String The display state of the NativeWindow before the change.

If the event is displayStateChanging, the display state has not yet changed; beforeDisplayState reflects the Window's current display state. If the event is displayStateChanged, beforeDisplayState indicates the previous value.

VideoEvent This event class reports the current video rendering status.Reports the current video rendering status. flash.events:Event

This event class reports the current video rendering status. Use this event for the following purposes:

  • To find out when size of the Video display changes or is initialized. Use this event instead of polling for size changes. When you receive this event you can access Video.videoSize and Video.videoHeight to get the pixel dimensions of the video that is currently playing.
  • To find out whether the video is decoded by software or the GPU. If the status property returns "accelerated", you should switch to using the StageVideo class, if possible.
flash.events.StageVideoEventflash.events.StageVideoAvailabilityEventflash.display.Stage.stageVideosflash.media.Videoflash.net.NetStreamWorking with VideoVideoEvent Constructor. typeStringThe type of event. Possible values are: VideoEvent.RENDER_STATE. bubblesBooleanfalseIndicates whether this Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseIndicates whether you can cancel the action that triggers this event. statusStringnullThe rendering state of the video. Constructor.

Constructor.

RENDER_STATE Defines the value of the type property of a renderState event object.renderStateStringThe identifier for the renderState event of the Video object. Defines the value of the type property of a renderState event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event.statusThe rendering status reported by the event.targetThe Video object reporting rendering status.
RENDER_STATUS_ACCELERATED For internal use only.acceleratedStringFor internal use only.

For internal use only. Use flash.media.VideoStatus.ACCELERATED instead.

RENDER_STATUS_SOFTWARE For internal use only.softwareStringFor internal use only.

For internal use only. Use flash.media.VideoStatus.SOFTWARE instead.

RENDER_STATUS_UNAVAILABLE For internal use only.unavailableStringFor internal use only.

For internal use only. Use flash.media.VideoStatus.UNAVAILABLE instead.

status Returns the rendering status of the VideoEvent object.StringReturns the rendering status of the VideoEvent object.

Returns the rendering status of the VideoEvent object. Possible values include "unavailable", "software", and "accelerated".

GestureEvent The GestureEvent class lets you handle multi-touch events on devices that detect complex user contact with the device (such as pressing two fingers on a touch screen at the same time).provides event handling support for touch interaction flash.events:Event The GestureEvent class lets you handle multi-touch events on devices that detect complex user contact with the device (such as pressing two fingers on a touch screen at the same time). When a user interacts with a device such as a mobile phone or tablet with a touch screen, the user typically touches and moves across the screen with his or her fingers or a pointing device. You can develop applications that respond to this user interaction with the GestureEvent and TransformGestureEvent classes. Create event listeners using the event types defined here, or in the related TouchEvent and TransformGestureEvent classes. And, use the properties and methods of these classes to construct event handlers that respond to the user touching the device.

Use the Multitouch class to determine the current environment's support for touch interaction, and to manage the support of touch interaction if the current environment supports it.

Note: When objects are nested on the display list, touch events target the deepest possible nested object that is visible in the display list. This object is called the target node. To have a target node's ancestor (an object containing the target node in the display list) receive notification of a touch event, use EventDispatcher.addEventListener() on the ancestor node with the type parameter set to the specific touch event you want to detect.

The following example shows event handling for the GESTURE_TWO_FINGER_TAP event. While the user performs a two-finger tap gesture, mySprite rotates and myTextField populates with the phase all, which is the only phase for two-finger tap events. Other gestures from the TransformGestureEvent class support begin, update, and end phases. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(GestureEvent.GESTURE_TWO_FINGER_TAP , onTwoFingerTap ); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onTwoFingerTap(evt:GestureEvent):void { evt.target.rotation -= 45; myTextField.text = evt.phase; //"all" }
flash.ui.Multitouchflash.events.TouchEventflash.events.TransformGestureEventflash.events.PressAndTapGestureEventflash.events.MouseEventflash.events.EventDispatcher.addEventListener()gestureTwoFingerTapflash.events:GestureEvent:GESTURE_TWO_FINGER_TAPflash.events:GestureEventflash.display.InteractiveObject.gestureTwoFingerTapflash.events.GesturePhaseGestureEvent Creates an Event object that contains information about multi-touch events (such as pressing two fingers on a touch screen at the same time).typeString The type of the event. The supported value is: GestureEvent.GESTURE_TWO_FINGER_TAP. bubblesBooleantrue Determines whether the Event object participates in the bubbling phase of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. phaseStringnullA value from the GesturePhase class indicating the progress of the touch gesture (begin, update, end, or all). localXNumber0The horizontal coordinate at which the event occurred relative to the containing sprite. localYNumber0The vertical coordinate at which the event occurred relative to the containing sprite. ctrlKeyBooleanfalseOn Windows or Linux, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. altKeyBooleanfalseIndicates whether the Alt key is activated (Windows or Linux only). shiftKeyBooleanfalseIndicates whether the Shift key is activated. commandKeyBooleanfalse(AIR only) Indicates whether the Command key is activated (Mac only). This parameter is for Adobe AIR only; do not set it for Flash Player content. controlKeyBooleanfalse(AIR only) Indicates whether the Control or Ctrl key is activated. This parameter is for Adobe AIR only; do not set it for Flash Player content. Constructor for GestureEvent objects. Creates an Event object that contains information about multi-touch events (such as pressing two fingers on a touch screen at the same time). Event objects are passed as parameters to event listeners. flash.events.GesturePhaseclone Creates a copy of the GestureEvent object and sets the value of each property to match that of the original.A new GestureEvent object with property values that match those of the original. flash.events:Event Creates a copy of the GestureEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the GestureEvent object.A string that contains all the properties of the GestureEvent object. String Returns a string that contains all the properties of the GestureEvent object. The string is in the following format:

[GestureEvent type=value bubbles=value cancelable=value ... ]

updateAfterEvent Refreshes the Flash runtime display after processing the gesture event, in case the display list has been modified by the event handler. Refreshes the Flash runtime display after processing the gesture event, in case the display list has been modified by the event handler. GESTURE_TWO_FINGER_TAP Defines the value of the type property of a GESTURE_TWO_FINGER_TAP gesture event object.gestureTwoFingerTapString Defines the value of the type property of a GESTURE_TWO_FINGER_TAP gesture event object.

The dispatched GestureEvent object has the following properties:

PropertyValuealtKeytrue if the Alt key is active (Windows or Linux).bubblestruecancelablefalse; there is no default behavior to cancel.commandKey(AIR only) true on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.phaseThe current phase in the event flow. For two-finger tap events, this value is always all corresponding to the value GesturePhase.ALL once the event is dispatched.isRelatedObjectInaccessibletrue if the relatedObject property is set to null because of security sandbox rules.localXThe horizontal coordinate at which the event occurred relative to the containing sprite.localYThe vertical coordinate at which the event occurred relative to the containing sprite.shiftKeytrue if the Shift key is active; false if it is inactive.targetThe InteractiveObject instance under the touching device. 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.
flash.display.InteractiveObject.gestureTwoFingerTapflash.events.GesturePhase
altKey Indicates whether the Alt key is active (true) or inactive (false).Boolean Indicates whether the Alt key is active (true) or inactive (false). Supported for Windows and Linux operating systems only. commandKey Indicates whether the command key is activated (Mac only).Boolean Indicates whether the command key is activated (Mac only).

On a Mac OS, the value of the commandKey property is the same value as the ctrlKey property. This property is always false on Windows or Linux.

controlKey Indicates whether the Control key is activated on Mac and whether the Ctrl key is activated on Windows or Linux.Boolean Indicates whether the Control key is activated on Mac and whether the Ctrl key is activated on Windows or Linux. ctrlKey On Windows or Linux, indicates whether the Ctrl key is active (true) or inactive (false).Boolean On Windows or Linux, indicates whether the Ctrl key is active (true) or inactive (false). On Macintosh, indicates whether either the Control key or the Command key is activated. localX The horizontal coordinate at which the event occurred relative to the containing sprite.Number The horizontal coordinate at which the event occurred relative to the containing sprite. localY The vertical coordinate at which the event occurred relative to the containing sprite.Number The vertical coordinate at which the event occurred relative to the containing sprite. phase A value from the GesturePhase class indicating the progress of the touch gesture.String A value from the GesturePhase class indicating the progress of the touch gesture. For most gestures, the value is begin, update, or end. For the swipe and two-finger tap gestures, the phase value is always all once the event is dispatched. Use this value to determine when an event handler responds to a complex user interaction, or responds in different ways depending on the current phase of a multi-touch gesture (such as expanding, moving, and "dropping" as a user touches and drags a visual object across a screen). flash.events.GesturePhaseshiftKey Indicates whether the Shift key is active (true) or inactive (false).Boolean Indicates whether the Shift key is active (true) or inactive (false). stageX The horizontal coordinate at which the event occurred in global Stage coordinates.Number The horizontal coordinate at which the event occurred in global Stage coordinates. This property is calculated when the localX property is set. stageY The vertical coordinate at which the event occurred in global Stage coordinates.Number The vertical coordinate at which the event occurred in global Stage coordinates. This property is calculated when the localY property is set.
FullScreenEvent The Stage object dispatches a FullScreenEvent object whenever the Stage enters or leaves full-screen display mode.Event objects for FullScreenEvent events. flash.events:ActivityEvent The Stage object dispatches a FullScreenEvent object whenever the Stage enters or leaves full-screen display mode. There is only one type of fullScreen event: FullScreenEvent.FULL_SCREEN. flash.display.Stage.displayStatefullScreenflash.events:FullScreenEvent:FULL_SCREENflash.events:FullScreenEventflash.display.Stage.displayStateFullScreenEvent Creates an event object that contains information about fullScreen events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of fullScreen event: FullScreenEvent.FULL_SCREEN. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. fullScreenBooleanfalseIndicates whether the device is activating (true) or deactivating (false). Event listeners can access this information through the activating property. Constructor for FullScreenEvent objects. Creates an event object that contains information about fullScreen events. Event objects are passed as parameters to event listeners. FullScreenEvent.FULL_SCREENclone Creates a copy of a FullScreenEvent object and sets the value of each property to match that of the original.A new FullScreenEvent object with property values that match those of the original. flash.events:Event Creates a copy of a FullScreenEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the FullScreenEvent object.A string that contains all the properties of the FullScreenEvent object. String Returns a string that contains all the properties of the FullScreenEvent object. The following format is used:

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

FULL_SCREEN The FullScreenEvent.FULL_SCREEN constant defines the value of the type property of a fullScreen event object.fullScreenString The FullScreenEvent.FULL_SCREEN constant defines the value of the type property of a fullScreen event object.

This event has the following properties:

PropertyValuefullScreentrue if the display state is full screen or false if it is normal.bubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe Stage object.
flash.display.Stage.displayState
fullScreen Indicates whether the Stage object is in full-screen mode (true) or not (false).Boolean Indicates whether the Stage object is in full-screen mode (true) or not (false).
StageVideoAvailabilityEvent This event fires when the state of the Stage.stageVideos property changes.Reports the current availability of stage video. flash.events:Event

This event fires when the state of the Stage.stageVideos property changes. This property can change when a user expands a video to full screen display from a wmode that does not support StageVideo (for example, wmode=normal, wmode=opaque, or wmode=transparent). Expanding to full screen can cause the Stage.stageVideos vector to become populated. Conversely, exiting full screen display can cause the Stage.stageVideos vector to become empty.

NOTE: This notification occurs only when the state of the Stage.stageVideos property changes. As a result, behavior may vary according to platform and browser. On Windows, for example, the stageVideoAvailability event is not dispatched when you go into full screen mode while wmode is set to direct. On some other platforms, however, the same behavior causes Flash Player to reallocate resources. In those cases, the Stage.stageVideos property state changes, and the event fires. You can detect changes to full screen mode by listening to the flash.events.FullScreenEvent event. This event is dispatched by the Stage object.

flash.events.StageVideoEventflash.media.StageVideoAvailabilityflash.events.VideoEventflash.events.FullScreenEventflash.display.Stage.stageVideosflash.events.FullScreenEventflash.media.Videoflash.net.NetStreamWorking with VideoStageVideoAvailabilityEvent Constructor. typeStringThe type of event. Possible values are: StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY. bubblesBooleanfalseIndicates whether this Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseIndicates whether you can cancel the action that triggers this event. availabilityStringnullThe current availability of stage video. Constructor.

Constructor.

STAGE_VIDEO_AVAILABILITY Defines the value of the type property of a stageVideoAvailability event object.stageVideoAvailabilityStringThe identifier for the stageVideoAvailability event of the Stage object. Defines the value of the type property of a stageVideoAvailability event object.

This event has the following properties:

PropertyValueavailabilityThe status reported by the event.bubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event.targetThe Stage object reporting on the availability of stage video.
availability Reports the current availability of stage video using a constant of the flash.media.StageVideoAvailability class. StringReports the current availability of stage video.

Reports the current availability of stage video using a constant of the flash.media.StageVideoAvailability class.

DatagramSocketDataEvent A DatagramSocketDataEvent object is dispatched when Datagram socket has received data.flash.events:Event A DatagramSocketDataEvent object is dispatched when Datagram socket has received data. DatagramSocket classdataflash.events:DatagramSocketDataEvent:DATAflash.events:DatagramSocketDataEventDispatched by a DatagramSocket object when a UDP packet is received. flash.net.DatagramSocket.dataDatagramSocketDataEvent Creates an Event object that contains information about datagram events.typeString The type of the event. Possible values are:DatagramSocketDataEvent.DATA bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. srcAddressStringThe IP address of the machine that sent the packet. srcPortint0The port on the machine that sent the packet. dstAddressStringThe IP address to which the packet is addressed. dstPortint0The port to which the packet is addressed. dataflash.utils:ByteArraynullThe datagram packet data. Creates an Event object that contains information about datagram events. Event objects are passed as parameters to event listeners. clone Creates a copy of the DatagramSocketDataEvent object and sets each property's value to match that of the original.A new DatagramSocketDataEvent object with property values that match those of the original. flash.events:Event Creates a copy of the DatagramSocketDataEvent object and sets each property's value to match that of the original. toString Returns a string that contains all the properties of the DatagramSocketDataEvent object.A string that contains all the properties of the ProgressEvent object. String Returns a string that contains all the properties of the DatagramSocketDataEvent object. The string is in the following format:

[DatagramSocketDataEvent type=value bubbles=value cancelable=value srcAddress=value srcPort=value dstAddress=value dstPort=value data=value]

DATA Defines the value of the type property of a data event object.dataStringDispatched by a DatagramSocket object when a UDP packet is received. Defines the value of the type property of a data event object. flash.net.DatagramSocket.datadata The datagram packet data.flash.utils:ByteArray The datagram packet data. dstAddress The IP address of the DatagramSocket object that dispatched this event.String The IP address of the DatagramSocket object that dispatched this event.

Note: If the socket is bound to the special address: 0.0.0.0, then this property will return 0.0.0.0. In order to know the specific IP to which the datagram message is sent, you must bind the socket to an explicit IP address.

dstPort The port of the DatagramSocket object that dispatched this event.int The port of the DatagramSocket object that dispatched this event. srcAddress The IP address of the machine that sent the packet.String The IP address of the machine that sent the packet. srcPort The port on the machine that sent the packet.int The port on the machine that sent the packet.
DRMStatusEvent A NetStream object dispatches a DRMStatusEvent object when the content protected using digital rights management (DRM) begins playing successfully (when the voucher is verified, and when the user is authenticated and authorized to view the content).Event objects for DRM-enabled objects. flash.events:Event A NetStream object dispatches a DRMStatusEvent object when the content protected using digital rights management (DRM) begins playing successfully (when the voucher is verified, and when the user is authenticated and authorized to view the content). The DRMStatusEvent object contains information related to the voucher, such as whether the content can be made available offline or when the voucher will expire and the content can no longer be viewed. The application can use this data to inform the user of the status of her policy and permissions. flash.net.NetStreamDRMStatusEvent.DRM_STATUSflash.net.drm.DRMManagerflash.net.drm.DRMVoucherdrmStatusflash.events:DRMStatusEvent:DRM_STATUSflash.events:DRMStatusEventDispatched by a NetStream object when DRM-protected content begins playing. DRMStatusEvent Creates an Event object that contains specific information about DRM status events.typeStringunknown The type of the event. Event listeners can access this information through the inherited type property. There is only one type of DRMAuthenticate event: DRMAuthenticateEvent.DRM_AUTHENTICATE. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. inMetadataflash.net.drm:DRMContentDatanullThe custom object that contains custom DRM properties. inVoucherflash.net.drm:DRMVouchernullThe context of the Event. inLocalBooleanfalseIndicates if content can be viewed offline. Creates an Event object that contains specific information about DRM status events. Event objects are passed as parameters to event listeners. clone Creates a copy of the DRMStatusEvent object and sets the value of each property to match that of the original.A new DRMStatusEvent object with property values that match those of the original. flash.events:Event Creates a copy of the DRMStatusEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the DRMStatusEvent object.A string that contains all the properties of the DRMStatusEvent object. String Returns a string that contains all the properties of the DRMStatusEvent object. DRM_STATUS The DRMStatusEvent.DRM_STATUS constant defines the value of the type property of a drmStatus event object.drmStatusStringDispatched by a NetStream object when DRM-protected content begins playing. The DRMStatusEvent.DRM_STATUS constant defines the value of the type property of a drmStatus event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.detailA string explaining the context of the status event.isAnonymousIndicates whether the content protected with DRM encryption is available without requiring a user to provide authentication credentials.isAvailableOfflineIndicates whether the content protected with DRM encryption is available offline.offlineLeasePeriodThe remaining number of days that content can be viewed offline.policiesA custom object of the DRM status event.targetThe NetStream object.voucherEndDateThe absolute date on which the voucher expires and the content can no longer be viewed by userscontentDataThe DRMContentData for the contentvoucherThe DRMVoucher object for the content.isLocalIndicates whether the content is stored on the local file system
contentData A DRMContentData object containing the information necessary to obtain a voucher for viewing the DRM-protected content.flash.net.drm:DRMContentData A DRMContentData object containing the information necessary to obtain a voucher for viewing the DRM-protected content. detail A string explaining the context of the status event.String A string explaining the context of the status event. isAnonymous Indicates whether the content, protected with digital rights management (DRM) encryption, is available without requiring a user to provide authentication credentials.Boolean Indicates whether the content, protected with digital rights management (DRM) encryption, is available without requiring a user to provide authentication credentials. If so, the value is true. Otherwise, the value is false, and a user must provide a username and password that matches the one known and expected by the content provider. isAvailableOffline Indicates whether the content, protected with digital rights management (DRM) encryption, is available offline.Boolean Indicates whether the content, protected with digital rights management (DRM) encryption, is available offline. If so, the value is true. Otherwise, the value is false.

In order for digitally protected content to be available offline, its voucher must be cached to the user's local machine. (The application decides where to store the content locally in order for it to be available offline.)

isLocal Indicates whether the voucher is cached in the local voucher store.Boolean Indicates whether the voucher is cached in the local voucher store. offlineLeasePeriod The remaining number of days that content can be viewed offline.uint The remaining number of days that content can be viewed offline. policies A custom object of the DRM status event.Object A custom object of the DRM status event. voucherEndDate The absolute date on which the voucher expires and the content can no longer be viewed by users.Date The absolute date on which the voucher expires and the content can no longer be viewed by users. voucher A DRMVoucher object for the content.flash.net.drm:DRMVoucher A DRMVoucher object for the content.
AsyncErrorEvent An object dispatches an AsyncErrorEvent when an exception is thrown from native asynchronous code, which could be from, for example, LocalConnection, NetConnection, SharedObject, or NetStream.Event objects for AsyncErrorEvent events. flash.events:ErrorEvent An object dispatches an AsyncErrorEvent when an exception is thrown from native asynchronous code, which could be from, for example, LocalConnection, NetConnection, SharedObject, or NetStream. There is only one type of asynchronous error event: AsyncErrorEvent.ASYNC_ERROR. ASYNC_ERRORasyncErrorflash.events:AsyncErrorEvent:ASYNC_ERRORflash.events:AsyncErrorEventAsyncErrorEvent Creates an AsyncErrorEvent object that contains information about asyncError events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of error event: ErrorEvent.ERROR. bubblesBooleanfalseDetermines whether the Event object bubbles. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. textStringText to be displayed as an error message. Event listeners can access this information through the text property. errorErrornullThe exception that occurred. If error is non-null, the event's errorId property is set from the error's errorId property. Constructor for AsyncErrorEvent objects. Creates an AsyncErrorEvent object that contains information about asyncError events. AsyncErrorEvent objects are passed as parameters to event listeners. clone Creates a copy of the AsyncErrorEvent object and sets the value of each property to match that of the original.A new AsyncErrorEvent object with property values that match those of the original. flash.events:Event Creates a copy of the AsyncErrorEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the AsyncErrorEvent object.A string that contains all the properties of the AsyncErrorEvent object. String Returns a string that contains all the properties of the AsyncErrorEvent object. The string is in the following format:

[AsyncErrorEvent type=value bubbles=value cancelable=value ... error=value errorID=value] The errorId is only available in Adobe AIR

ASYNC_ERROR The AsyncErrorEvent.ASYNC_ERROR constant defines the value of the type property of an asyncError event object.asyncErrorString The AsyncErrorEvent.ASYNC_ERROR constant defines the value of the type property of an asyncError event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object dispatching the event.errorThe error that triggered the event.
error The exception that was thrown.Error The exception that was thrown.
StatusEvent An object dispatches a StatusEvent object when a device, such as a camera or microphone, or an object such as a LocalConnection object reports its status.Event objects for StatusEvent events. flash.events:Event An object dispatches a StatusEvent object when a device, such as a camera or microphone, or an object such as a LocalConnection object reports its status. There is only one type of status event: StatusEvent.STATUS. flash.media.Cameraflash.media.Microphoneflash.net.LocalConnectionflash.sensors.Accelerometerflash.sensors.Geolocationair.net.ServiceMonitorstatusflash.events:StatusEvent:STATUSflash.events:StatusEventflash.media.Camera.statusflash.media.Microphone.statusflash.net.LocalConnection.statusflash.net.NetStream.statusflash.sensors.Geolocation.statusflash.sensors.Accelerometer.statusStatusEvent Creates an Event object that contains information about status events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of status event: StatusEvent.STATUS. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. codeStringA description of the object's status. Event listeners can access this information through the code property. levelStringThe category of the message, such as "status", "warning" or "error". Event listeners can access this information through the level property. Constructor for StatusEvent objects. Creates an Event object that contains information about status events. Event objects are passed as parameters to event listeners. STATUSclone Creates a copy of the StatusEvent object and sets the value of each property to match that of the original.A new StatusEvent object with property values that match those of the original. flash.events:Event Creates a copy of the StatusEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the StatusEvent object.A string that contains all the properties of the StatusEvent object. String Returns a string that contains all the properties of the StatusEvent object. The string is in the following format:

[StatusEvent type=value bubbles=value cancelable=value code=value level=value]

STATUS Defines the value of the type property of a status event object.statusString Defines the value of the type property of a status event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.codeA description of the object's status.currentTargetThe object that is actively processing the Event object with an event listener.levelThe category of the message, such as "status", "warning" or "error".targetThe object reporting its status.
flash.media.Camera.statusflash.media.Microphone.statusflash.net.LocalConnection.statusflash.net.NetStream.statusflash.sensors.Geolocation.statusflash.sensors.Accelerometer.status
code A description of the object's status.String A description of the object's status. flash.media.Cameraflash.media.Microphoneflash.net.LocalConnectionlevel The category of the message, such as "status", "warning" or "error".String The category of the message, such as "status", "warning" or "error". flash.media.Cameraflash.media.Microphoneflash.net.LocalConnection
DRMAuthenticationErrorEvent The DRMManager dispatches a DRMAuthenticationErrorEvent object when a call to the authenticate() method of the DRMManager object fails.flash.events:ErrorEvent The DRMManager dispatches a DRMAuthenticationErrorEvent object when a call to the authenticate() method of the DRMManager object fails. DRMAuthenticationErrorEvent Creates a new instance of a DRMAuthenticationErrorEvent object.typeStringthe event type string bubblesBooleanfalsewhether the event bubbles up the display list cancelableBooleanfalsewhether the event can be canceled inDetailStringThe error description inErrorIDint0The ID of the general type of error inSubErrorIDint0The ID indicating the specific error within its type inServerURLStringnullthe URL of the logged-in server inDomainStringnullthe authenticated domain on the logged-in server Creates a new instance of a DRMAuthenticationErrorEvent object. clone Creates a copy of the ErrorEvent object and sets the value of each property to match that of the original.A new ErrorEvent object with property values that match those of the original. flash.events:Event Creates a copy of the ErrorEvent object and sets the value of each property to match that of the original. AUTHENTICATION_ERROR The string constant to use for the authentication error event in the type parameter when adding and removing event listeners.authenticationErrorString The string constant to use for the authentication error event in the type parameter when adding and removing event listeners. domain The content domain of the media rights server.String The content domain of the media rights server. Here, domain is not a network or Internet domain name. serverURL The URL of the media rights server that rejected the authentication attempt.String The URL of the media rights server that rejected the authentication attempt. subErrorID A more detailed error code.int A more detailed error code. HTMLUncaughtScriptExceptionEvent An HTMLLoader object dispatches an HTMLUncaughtScriptExceptionEvent object whenever a JavaScript exception is thrown and not handled with a catch statement.flash.events:Event An HTMLLoader object dispatches an HTMLUncaughtScriptExceptionEvent object whenever a JavaScript exception is thrown and not handled with a catch statement. HTMLLoaderuncaughtScriptExceptionflash.events:HTMLUncaughtScriptExceptionEvent:UNCAUGHT_SCRIPT_EXCEPTIONflash.events:HTMLUncaughtScriptExceptionEventHTMLUncaughtScriptExceptionEvent Creates an HTMLUncaughtScriptExceptionEvent object to pass as a parameter to event listeners.exceptionValueWhen a JavaScript process throws an uncaught exception, the exceptionValue is the result of evaluating the expression in the throw statement that resulted in the uncaught exception. The exceptionValue property can be a primitive value, a reference to a JavaScript object, or a reference to an ActionScript object. Creates an HTMLUncaughtScriptExceptionEvent object to pass as a parameter to event listeners. clone Creates a copy of the HTMLUncaughtScriptExceptionEvent object and sets the value of each property to match that of the original.The copy of the HTMLUncaughtScriptExceptionEvent object. flash.events:Event Creates a copy of the HTMLUncaughtScriptExceptionEvent object and sets the value of each property to match that of the original. UNCAUGHT_SCRIPT_EXCEPTION The HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION constant defines the value of the type property of an uncaughtScriptException event object.uncaughtScriptException The HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION constant defines the value of the type property of an uncaughtScriptException event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.exceptionValueThe result of evaluating the expression in the throw statement that resulted in the uncaught exception.stackTraceAn array of objects that represent the stack trace at the time the throw statement that resulted in the uncaught exception was executed.targetThe HTMLLoader object.
exceptionValue The result of evaluating the expression in the throw statement that resulted in the uncaught exception. The result of evaluating the expression in the throw statement that resulted in the uncaught exception. The exceptionValue property can be a primitive value, a reference to a JavaScript object, or a reference to an ActionScript object. stackTrace An array of objects that represent the stack trace at the time the throw statement that resulted in the uncaught exception was executed.Array An array of objects that represent the stack trace at the time the throw statement that resulted in the uncaught exception was executed. Each object in the array has three properties:
  • sourceURL (a string): The URL of the script of the call stack frame.
  • line (a number): The line number in the sourceURL resource of the call stack frame.
  • functionName (a string): The name of the function for the call stack frame.
SoftKeyboardEvent A SoftKeyboardEvent object is dispatched when a virtual keyboard is activated or deactivated.A SoftKeyboardEvent is dispatched when a soft keyboard is activated or deactivated. flash.events:Event A SoftKeyboardEvent object is dispatched when a virtual keyboard is activated or deactivated.

SoftKeyboardEvents are dispatched by TextFields and by InteractiveObjects that have their needsSoftKeyboardproperty set to true.

flash.display.InteractiveObject.needsSoftKeyboardSoftKeyboardEvent Creates an event object that contains information about soft keyboard activation and deactivation events.typeString The type of the event as a constant value (such as SOFT_KEYBOARD_ACTIVATE). Event listeners can access this information through the inherited type property. bubblesBooleanDetermines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. relatedObjectValflash.display:InteractiveObjectA reference to a display list object that is related to the event. triggerTypeValStringIndicates whether the keyboard event was triggered by an application or user. Constructor for SoftKeyboardEvent objects. Creates an event object that contains information about soft keyboard activation and deactivation events. Event objects are passed as parameters to event listeners. clone Creates a copy of a SoftKeyboardEvent object and sets the value of each property to match that of the original.A new SoftKeyboardEvent object with property values that match those of the original. flash.events:EventCreates a copy of a SoftKeyboardEvent object. Creates a copy of a SoftKeyboardEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the SoftKeyboardEvent object.A string that contains all the properties of the SoftKeyboardEvent object. String Returns a string that contains all the properties of the SoftKeyboardEvent object. The following format is used:

[SoftKeyboardEvent type=value bubbles=value cancelable=value relatedObjectVal=value triggerTypeVal=value activating=value]

SOFT_KEYBOARD_ACTIVATE The SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE constant defines the value of the type property of the SoftKeyboardEvent object dispatched when a soft keyboard is displayed.softKeyboardActivateStringConstant value for an event dispatched when the soft keyboard is displayed. The SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE constant defines the value of the type property of the SoftKeyboardEvent object dispatched when a soft keyboard is displayed.

The softKeyboardActivate event is dispatched after the softKeyboardActivating event and cannot be canceled. To prevent the virtual keyboard from displaying, cancel the softKeyboardActivating event.

This event has the following properties:

PropertyValuetypeSOFT_KEYBOARD_ACTIVATEbubblestruecancelablefalse; it is too late to cancel.relatedObjectValA reference to a display list object that is related to the event.triggerTypeValIndicates whether the keyboard event was triggered by an application or user.currentTargetThe object that is actively processing the Event object with an event listener.
SOFT_KEYBOARD_ACTIVATING The SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING constant defines the value of the type property of the SoftKeyboardEvent object dispatched immediately before a soft keyboard is displayed.softKeyboardActivatingStringConstant value for an event dispatched immediately before the soft keyboard is displayed. The SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING constant defines the value of the type property of the SoftKeyboardEvent object dispatched immediately before a soft keyboard is displayed. If canceled by calling preventDefault, the soft keyboard does not open.

This event has the following properties:

PropertyValuetypeSOFT_KEYBOARD_ACTIVATINGbubblestruecancelabletrue; canceling prevents the keyboard from opening.relatedObjectValA reference to a display list object that is related to the event.triggerTypeValIndicates whether the keyboard event was triggered by an application or user.currentTargetThe object that is actively processing the Event object with an event listener.
SOFT_KEYBOARD_DEACTIVATE The SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE constant defines the value of the type property of the SoftKeyboardEvent object dispatched when a soft keyboard is lowered or hidden..softKeyboardDeactivateStringConstant value for an event dispatched after the soft keyboard is lowered or hidden. The SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE constant defines the value of the type property of the SoftKeyboardEvent object dispatched when a soft keyboard is lowered or hidden..

This event has the following properties:

PropertyValuetypeSOFT_KEYBOARD_DEACTIVATEbubblestruecancelablefalse; canceling is not allowed.relatedObjectValA reference to a display list object that is related to the event.triggerTypeValIndicates whether the keyboard event was triggered by an application or user.currentTargetThe object that is actively processing the Event object with an event listener.
relatedObject A reference to a display list object that is related to the event.flash.display:InteractiveObjectA reference to a display list object that is related to the event. A reference to a display list object that is related to the event. triggerType Indicates whether the change in keyboard status has been triggered by an application (such as programmatic use of requestSoftKeyboard()) or by the user (such as selecting a text field).StringThe source of the change in keyboard status. Indicates whether the change in keyboard status has been triggered by an application (such as programmatic use of requestSoftKeyboard()) or by the user (such as selecting a text field). flash.events.SoftKeyboardTrigger
ProgressEvent A ProgressEvent object is dispatched when a load operation has begun or a socket has received data.Event objects for ProgressEvent events. flash.events:Event A ProgressEvent object is dispatched when a load operation has begun or a socket has received data. These events are usually generated when SWF files, images or data are loaded into an application. There are two types of progress events: ProgressEvent.PROGRESS and ProgressEvent.SOCKET_DATA. Additionally, in AIR ProgressEvent objects are dispatched when a data is sent to or from a child process using the NativeProcess class. The following example uses the ProgressEventExample class to illustrate how various event listeners are used when a file is being downloaded. The example carries out the following tasks:
  1. The properties downloadURL and fileName are created, which indicate the location and name of the download file.
  2. In the ProgressEventExample constructor, a new FileReference object named file is created and then passed to the configureListeners() method.
  3. The downloadURL and fileName properties are then passed to file.download(), which prompts for the location to download the file.
  4. The configureListeners() method adds seven event listeners and their associated subscriber methods:
    1. cancel/cancelHandler() is dispatched if the file download is canceled.
    2. complete/complereHandler() is dispatched when the file download process is finished.
    3. ioError/ioErrorHandler() is dispatched if the download file is unavailable or inaccessible.
    4. open/openHandler() is dispatched when the download operation has started.
    5. progress/progressHandler() is dispatched when the download process begins and again when it ends.
    6. securityError/securityErrorHandler is dispatched if the local playback security setting does not match the type of data access for the download file (local versus network); see the notes below.
    7. select/selectHandler() is dispatched when the download object is selected.

Notes:

  • You need to compile the SWF file with Local Playback Security set to Access Network Files Only.
  • This example requires a file named SomeFile.pdf.
  • Although this example makes use of all events available to the FileReference object, most situations require only a subset.

package { import flash.display.Sprite; import flash.events.*; import flash.net.FileReference; import flash.net.URLRequest; public class ProgressEventExample extends Sprite { private var downloadURL:String = "http://www.[yourDomain].com/SomeFile.pdf"; private var fileName:String = "SomeFile.pdf"; private var file:FileReference; public function ProgressEventExample() { var request:URLRequest = new URLRequest(downloadURL); file = new FileReference(); configureListeners(file); file.download(request, fileName); } private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(Event.CANCEL, cancelHandler); dispatcher.addEventListener(Event.COMPLETE, completeHandler); dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); dispatcher.addEventListener(Event.OPEN, openHandler); dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler); dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); dispatcher.addEventListener(Event.SELECT, selectHandler); } private function cancelHandler(event:Event):void { trace("cancelHandler: " + event); } private function completeHandler(event:Event):void { trace("completeHandler: " + event); } private function ioErrorHandler(event:IOErrorEvent):void { trace("ioErrorHandler: " + event); } private function openHandler(event:Event):void { trace("openHandler: " + event); } private function progressHandler(event:ProgressEvent):void { var file:FileReference = FileReference(event.target); trace("progressHandler: name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace("securityErrorHandler: " + event); } private function selectHandler(event:Event):void { var file:FileReference = FileReference(event.target); trace("selectHandler: name=" + file.name + " URL=" + downloadURL); } } }
FileStream classLoaderInfo classSocket classprogressflash.events:ProgressEvent:PROGRESSflash.events:ProgressEventflash.display.LoaderInfo.progressflash.media.Sound.progressflash.net.FileReference.progressflash.net.URLLoader.progressflash.net.URLStream.progresssocketDataflash.events:ProgressEvent:SOCKET_DATAflash.events:ProgressEventflash.net.Socket.socketDataerrorDataflash.events:ProgressEvent:STANDARD_ERROR_DATAflash.events:ProgressEventflash.desktop.NativeProcess.standardErrorDataerrorDataflash.events:ProgressEvent:STANDARD_INPUT_PROGRESSflash.events:ProgressEventflash.desktop.NativeProcess.standardInputProgressoutputDataflash.events:ProgressEvent:STANDARD_OUTPUT_DATAflash.events:ProgressEventflash.desktop.NativeProcess.standardOutputDataProgressEvent Creates an Event object that contains information about progress events.typeString The type of the event. Possible values are:ProgressEvent.PROGRESS, ProgressEvent.SOCKET_DATA, ProgressEvent.STANDARD_ERROR_DATA, ProgressEvent.STANDARD_INPUT_PROGRESS, and ProgressEvent.STANDARD_OUTPUT_DATA. bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. bytesLoadedNumber0The number of items or bytes loaded at the time the listener processes the event. bytesTotalNumber0The total number of items or bytes that will be loaded if the loading process succeeds. Constructor for ProgressEvent objects. Creates an Event object that contains information about progress events. Event objects are passed as parameters to event listeners. clone Creates a copy of the ProgressEvent object and sets each property's value to match that of the original.A new ProgressEvent object with property values that match those of the original. flash.events:Event Creates a copy of the ProgressEvent object and sets each property's value to match that of the original. toString Returns a string that contains all the properties of the ProgressEvent object.A string that contains all the properties of the ProgressEvent object. String Returns a string that contains all the properties of the ProgressEvent object. The string is in the following format:

[ProgressEvent type=value bubbles=value cancelable=value bytesLoaded=value bytesTotal=value]

PROGRESS Defines the value of the type property of a progress event object.progressString Defines the value of the type property of a progress event object.

This event has the following properties:

PropertyValuebubblesfalsebytesLoadedThe number of items or bytes loaded at the time the listener processes the event.bytesTotalThe total number of items or bytes that ultimately will be loaded if the loading process succeeds.cancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object reporting progress.
flash.display.LoaderInfo.progressflash.media.Sound.progressflash.net.FileReference.progressflash.net.URLLoader.progressflash.net.URLStream.progress
SOCKET_DATA Defines the value of the type property of a socketData event object.socketDataString Defines the value of the type property of a socketData event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event.bytesLoadedThe number of items or bytes loaded at the time the listener processes the event.bytesTotal0; this property is not used by socketData event objects.targetThe socket reporting progress.
flash.net.Socket.socketData
STANDARD_ERROR_DATA Defines the value of the type property of a standardErrorData event object.standardErrorDataString Defines the value of the type property of a standardErrorData event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event.bytesLoadedThe number of bytes of error data buffered by the NativeProcessObject.error due to this event.bytesTotal0; this property is not used by standardErrorData event objects.targetThe NativeProcess object reporting error data.
flash.desktop.NativeProcess.standardErrorData
STANDARD_INPUT_PROGRESS Defines the value of the type property of a standardInputProgress event object.standardInputProgressString Defines the value of the type property of a standardInputProgress event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event.bytesLoadedThe number of bytes of error data buffered by the NativeProcessObject.error due to this event.bytesTotal0; this property is not used by standardInputProgress event objects.targetThe NativeProcess object reporting error data.
flash.desktop.NativeProcess.standardInputProgress
STANDARD_OUTPUT_DATA Defines the value of the type property of a standardOutputData event object.standardOutputDataString Defines the value of the type property of a standardOutputData event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event.bytesLoadedThe number of bytes of output data buffered by the NativeProcessObject.output due to this event.bytesTotal0; this property is not used by standardOutputData event objects.targetThe NativeProcess object reporting output data.
flash.desktop.NativeProcess.standardOutputData
bytesLoaded The number of items or bytes loaded when the listener processes the event.Number The number of items or bytes loaded when the listener processes the event. bytesTotal The total number of items or bytes that will be loaded if the loading process succeeds.Number The total number of items or bytes that will be loaded if the loading process succeeds. If the progress event is dispatched/attached to a Socket object, the bytesTotal will always be 0 unless a value is specified in the bytesTotal parameter of the constructor. The actual number of bytes sent back or forth is not set and is up to the application developer.
ShaderEvent A ShaderEvent is dispatched when a shader operation launched from a ShaderJob finishes.flash.events:Event A ShaderEvent is dispatched when a shader operation launched from a ShaderJob finishes. flash.display.ShaderJobcompleteflash.events:ShaderEvent:COMPLETEflash.events:ShaderEventflash.display.ShaderJob.completeShaderEvent Creates a ShaderEvent object to pass to event listeners.typeStringThe type of the event, available in the type property. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. The default value is false. cancelableBooleanfalseDetermines whether the Event object can be canceled. The default value is false. bitmapflash.display:BitmapDatanullThe BitmapData object containing the result of the operation that finished (or null if the target wasn't a BitmapData object). arrayflash.utils:ByteArraynullThe ByteArray object containing the result of the operation that finished (or null if the target wasn't a ByteArray object). vectornullThe Vector.<Number> instance containing the result of the operation that finished (or null if the target wasn't a Vector.<Number> instance). Creates a ShaderEvent object to pass to event listeners. clone Creates a copy of the ShaderEvent object and sets the value of each property to match that of the original.A new ShaderEvent object with property values that match the values of the original. flash.events:Event Creates a copy of the ShaderEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the ShaderEvent object.A string that contains all the properties of the ShaderEvent object. String Returns a string that contains all the properties of the ShaderEvent object. The string is in the following format:

[ShaderEvent type=value bubbles=value cancelable=value eventPhase=value bitmapData=value byteArray=value vector=value]

COMPLETE Defines the value of the type property of a complete event object.completeString Defines the value of the type property of a complete event object.

This event has the following properties:

PropertyValuebubblesfalsebitmapDataThe BitmapData object containing the result of the operation that finished (or null if the target wasn't a BitmapData object).byteArrayThe ByteArray object containing the result of the operation that finished (or null if the target wasn't a ByteArray object).cancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe ShaderJob object reporting completion.vectorThe Vector.<Number> instance containing the result of the operation that finished (or null if the target wasn't a Vector.<Number> instance).
flash.display.ShaderJob.complete
bitmapData The BitmapData object that was passed to the ShaderJob.start() method.flash.display:BitmapData The BitmapData object that was passed to the ShaderJob.start() method. If a ByteArray or Vector.<Number> was passed to the start() method this property is null. flash.display.ShaderJob.start()byteArray The ByteArray object that was passed to the ShaderJob.start() method.flash.utils:ByteArray The ByteArray object that was passed to the ShaderJob.start() method. If a BitmapData or Vector.<Number> object was passed to the start() method this property is null. flash.display.ShaderJob.start()vector The Vector.&lt;Number&gt; object that was passed to the ShaderJob.start() method. The Vector.<Number> object that was passed to the ShaderJob.start() method. If a BitmapData or ByteArray object was passed to the start() method this property is null. flash.display.ShaderJob.start()
DRMAuthenticationCompleteEvent The DRMManager dispatches a DRMAuthenticationCompleteEvent object when a call to the authenticate() method of the DRMManager object succeeds.flash.events:Event The DRMManager dispatches a DRMAuthenticationCompleteEvent object when a call to the authenticate() method of the DRMManager object succeeds. DRMAuthenticationCompleteEvent Creates a new instance of a DRMAuthenticationCompleteEvent object.typeStringthe event type string bubblesBooleanfalsewhether the event bubbles up the display list cancelableBooleanfalsewhether the event can be canceled inServerURLStringnullthe URL of the logged-in server inDomainStringnullthe authenticated domain on the logged-in server inTokenflash.utils:ByteArraynullthe authentication token Creates a new instance of a DRMAuthenticationCompleteEvent object. clone Duplicates an instance of an Event subclass.A new Event object that is identical to the original. flash.events:Event Duplicates an instance of an Event subclass.

Returns a new Event object that is a copy of the original instance of the Event object. You do not normally call clone(); the EventDispatcher class calls it automatically when you redispatch an event—that is, when you call dispatchEvent(event) from a handler that is handling event.

The new Event object includes all the properties of the original.

When creating your own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when listeners handle the redispatched event.

In this example, PingEvent is a subclass of Event and therefore implements its own version of clone().

class PingEvent extends Event { var URL:String; public override function clone():Event { return new PingEvent(type, bubbles, cancelable, URL); } }
AUTHENTICATION_COMPLETE The string constant to use for the authentication complete event in the type parameter when adding and removing event listeners.authenticationCompleteString The string constant to use for the authentication complete event in the type parameter when adding and removing event listeners. domain The content domain of the media rights server.String The content domain of the media rights server. Here, domain is not a network or Internet domain name. serverURL The URL of the media rights server.String The URL of the media rights server. token The authentication token.flash.utils:ByteArray The authentication token.

The authentication is automatically added to the DRMManager session cache. You can save the token and use it to authenticate the user in a future session. Reuse a token with the setAuthenticationToken() method of the DRMManager. Token expiration and other properties are determined by the server generating the token.

flash.net.drm.DRMManager.setAuthenticationToken()
AccelerometerEvent The Accelerometer class dispatches AccelerometerEvent objects when acceleration updates are obtained from the Accelerometer sensor installed on the device.flash.events:Event The Accelerometer class dispatches AccelerometerEvent objects when acceleration updates are obtained from the Accelerometer sensor installed on the device. flash.sensors.Accelerometerupdateflash.events:AccelerometerEvent:UPDATEflash.events:AccelerometerEventAccelerometerEvent Creates an AccelerometerEvent object that contains information about acceleration along three dimensional axis.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of update event: AccelerometerEvent.UPDATE. bubblesBooleanfalseDetermines whether the Event object bubbles. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. timestampNumber0The timestamp of the Accelerometer update. accelerationXNumber0The acceleration value in Gs (9.8m/sec/sec) along the x-axis. accelerationYNumber0The acceleration value in Gs (9.8m/sec/sec) along the y-axis. accelerationZNumber0The acceleration value in Gs (9.8m/sec/sec) along the z-axis. Constructor for AccelerometerEvent objects. Creates an AccelerometerEvent object that contains information about acceleration along three dimensional axis. Event objects are passed as parameters to event listeners. clone Creates a copy of an AccelerometerEvent object and sets the value of each property to match that of the original.A new AccelerometerEvent object with property values that match those of the original. flash.events:Event Creates a copy of an AccelerometerEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the AccelerometerEvent object.A string that contains all the properties of the AccelerometerEvent object. String Returns a string that contains all the properties of the AccelerometerEvent object. The following format is used:

[AccelerometerEvent type=value bubbles=value cancelable=value timestamp=value accelerationX=value accelerationY=value accelerationZ=value ]

UPDATE Defines the value of the type property of a AccelerometerEvent event object.updateString Defines the value of the type property of a AccelerometerEvent event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.timestampThe timestamp of the Accelerometer update.accelerationXThe acceleration value in Gs (9.8m/sec/sec) along the x-axis.accelerationYThe acceleration value in Gs (9.8m/sec/sec) along the y-axis. accelerationZThe acceleration value in Gs (9.8m/sec/sec) along the z-axis.
accelerationX Acceleration along the x-axis, measured in Gs.Number Acceleration along the x-axis, measured in Gs. (1 G is roughly 9.8 m/sec/sec.) The x-axis runs from the left to the right of the device when it is in the upright position. The acceleration is positive if the device moves towards the right. accelerationY Acceleration along the y-axis, measured in Gs.Number Acceleration along the y-axis, measured in Gs. (1 G is roughly 9.8 m/sec/sec.). The y-axis runs from the bottom to the top of the device when it is in the upright position. The acceleration is positive if the device moves up relative to this axis. accelerationZ Acceleration along the z-axis, measured in Gs.Number Acceleration along the z-axis, measured in Gs. (1 G is roughly 9.8 m/sec/sec.). The z-axis runs perpendicular to the face of the device. The acceleration is positive if you move the device so that the face moves higher. timestamp The number of milliseconds at the time of the event since the runtime was initialized.Number The number of milliseconds at the time of the event since the runtime was initialized. For example, if the device captures accelerometer data 4 seconds after the application initializes, then the timestamp property of the event is set to 4000.
IMEEvent An IMEEvent object is dispatched when the user enters text using an input method editor (IME).Event objects for IMEEvent events. flash.events:TextEvent An IMEEvent object is dispatched when the user enters text using an input method editor (IME). IMEs are generally used to enter text from languages that have ideographs instead of letters, such as Japanese, Chinese, and Korean. There are two IME events: IMEEvent.IME_COMPOSITION and IMEEvent.IME_START_COMPOSITION. flash.system.IMEflash.events.IMEEvent.IME_COMPOSITIONflash.events.IMEEvent.IME_START_COMPOSITIONimeCompositionflash.events:IMEEvent:IME_COMPOSITIONflash.events:IMEEventflash.system.IME.imeCompositionimeCompositionflash.events:IMEEvent:IME_START_COMPOSITIONflash.events:IMEEventflash.system.IME.imeCompositionIMEEvent Creates an Event object with specific information relevant to IME events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one IME event: IMEEvent.IME_COMPOSITION. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. textStringThe reading string from the IME. This is the initial string as typed by the user, before selection of any candidates. The final composition string is delivered to the object with keyboard focus in a TextEvent.TEXT_INPUT event. Event listeners can access this information through the text property. imeClientflash.text.ime:IIMEClientnullA set of callbacks used by the text engine to communicate with the IME. Useful if your code has its own text engine and is rendering lines of text itself, rather than using TextField objects or the TextLayoutFramework. Constructor for IMEEvent objects. Creates an Event object with specific information relevant to IME events. Event objects are passed as parameters to event listeners. flash.system.IMEflash.events.IMEEvent.IME_COMPOSITIONflash.events.IMEEvent.IME_START_COMPOSITIONclone Creates a copy of the IMEEvent object and sets the value of each property to match that of the original.A new IMEEvent object with property values that match those of the original. flash.events:Event Creates a copy of the IMEEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the IMEEvent object.A string that contains all the properties of the IMEEvent object. String Returns a string that contains all the properties of the IMEEvent object. The string is in the following format:

[IMEEvent type=value bubbles=value cancelable=value text=value]

IME_COMPOSITION Defines the value of the type property of an imeComposition event object.imeCompositionString Defines the value of the type property of an imeComposition event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe IME object.
flash.system.IME.imeComposition
IME_START_COMPOSITION To handle IME text input, the receiver must set the imeClient field of the event to an object that implements the IIMEClient interface.imeStartCompositionString To handle IME text input, the receiver must set the imeClient field of the event to an object that implements the IIMEClient interface. If imeClient is unset, the runtime uses out-of-line IME composition instead, and sends the final composition as a TEXT_INPUT event.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe IME object.
flash.system.IME.imeComposition
imeClient Specifies an object that implements the IMEClient interface.flash.text.ime:IIMEClient Specifies an object that implements the IMEClient interface. Components based on the flash.text.engine package must implement this interface to support editing text inline using an IME.
DataEvent An object dispatches a DataEvent object when raw data has completed loading.Event objects for DataEvent events. flash.events:TextEvent An object dispatches a DataEvent object when raw data has completed loading. There are two types of data event:
  • DataEvent.DATA: dispatched for data sent or received.
  • DataEvent.UPLOAD_COMPLETE_DATA: dispatched when data is sent and the server has responded.
The following example creates an XMLSocket and connects it to a socket server running on port 8080 of yourDomain. An event listener is attached to the XMLSocket object that listens for data events, which are dispatched whenever raw data is received.

Notes:

  • To generate a securityError event in this example, you need to compile the SWF file with "Local playback security" set to "Access network only".
  • You need a server running on [yourDomain] using port 8080.

package { import flash.display.Sprite; import flash.events.DataEvent; import flash.net.XMLSocket; public class DataEventExample extends Sprite { private var hostName:String = "[yourDomain]"; private var port:uint = 8080; private var socket:XMLSocket; public function DataEventExample() { socket = new XMLSocket(); socket.addEventListener(DataEvent.DATA, dataHandler); socket.connect(hostName, port); } private function dataHandler(event:DataEvent):void { trace("dataHandler: " + event.data); } } }
flash.net.FileReferenceflash.net.XMLSocketdataflash.events:DataEvent:DATAflash.events:DataEventflash.net.XMLSocket.datauploadCompleteDataflash.events:DataEvent:UPLOAD_COMPLETE_DATAflash.events:DataEventflash.net.FileReference.uploadCompleteDataDataEvent Creates an event object that contains information about data events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of data event: DataEvent.DATA. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. dataStringThe raw data loaded into Flash Player or Adobe AIR. Event listeners can access this information through the data property. Constructor for DataEvent objects. Creates an event object that contains information about data events. Event objects are passed as parameters to event listeners. flash.net.XMLSocketDataEvent.DATAclone Creates a copy of the DataEvent object and sets the value of each property to match that of the original.A new DataEvent object with property values that match those of the original. flash.events:Event Creates a copy of the DataEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the DataEvent object.A string that contains all the properties of the DataEvent object. String Returns a string that contains all the properties of the DataEvent object. The string is in the following format:

[DataEvent type=value bubbles=value cancelable=value data=value]

DATA Defines the value of the type property of a data event object.dataString Defines the value of the type property of a data event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.dataThe raw data loaded into Flash Player or Adobe AIR.targetThe XMLSocket object receiving data.
flash.net.XMLSocket.data
UPLOAD_COMPLETE_DATA Defines the value of the type property of an uploadCompleteData event object.uploadCompleteDataString Defines the value of the type property of an uploadCompleteData event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.dataThe raw data returned from the server after a successful file upload.targetThe FileReference object receiving data after a successful upload.
flash.net.FileReference.uploadCompleteData
data The raw data loaded into Flash Player or Adobe AIR.String The raw data loaded into Flash Player or Adobe AIR.
SecurityErrorEvent An object dispatches a SecurityErrorEvent object to report the occurrence of a security error.Event objects for SecurityErrorEvent events. flash.events:ErrorEvent An object dispatches a SecurityErrorEvent object to report the occurrence of a security error. Security errors reported through this class are generally from asynchronous operations, such as loading data, in which security violations may not manifest immediately. Your event listener can access the object's text property to determine what operation was attempted and any URLs that were involved. If there are no event listeners, the debugger version of Flash Player or the AIR Debug Launcher (ADL) application automatically displays an error message that contains the contents of the text property. There is one type of security error event: SecurityErrorEvent.SECURITY_ERROR.

Security error events are the final events dispatched for any target object. This means that any other events, including generic error events, are not dispatched for a target object that experiences a security error.

The following example uses the SecurityErrorEventExample class to show how a listener method securityErrorHandler() can be instantiated and set to listen for securityError events to be dispatched. This event will occur when a URLRequest location is not in exactly the same domain as the calling SWF, and the requested domain has not authorized cross-domain access by way of a cross-domain policy file.

To create a SecurityErrorEvent, replace http://www.[yourdomain].com with a path that has not been authorized for cross domain access.

package { import flash.display.Sprite; import flash.net.URLLoader; import flash.net.URLRequest; import flash.events.SecurityErrorEvent; public class SecurityErrorEventExample extends Sprite { public function SecurityErrorEventExample() { var loader:URLLoader = new URLLoader(); loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); var request:URLRequest = new URLRequest("http://www.[yourDomain].com"); loader.load(request); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace("securityErrorHandler: " + event); } } }
Security classSECURITY_ERRORsecurityErrorflash.events:SecurityErrorEvent:SECURITY_ERRORflash.events:SecurityErrorEventflash.net.FileReference.securityErrorflash.net.LocalConnection.securityErrorflash.net.NetConnection.securityErrorflash.net.Socket.securityErrorflash.net.URLLoader.securityErrorflash.net.URLStream.securityErrorflash.net.XMLSocket.securityErrorSecurityErrorEvent Creates an Event object that contains information about security error events.typeStringThe type of the event. Event listeners can access this information through the inherited type property. There is only one type of error event: SecurityErrorEvent.SECURITY_ERROR. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. textStringText to be displayed as an error message. Event listeners can access this information through the text property. idint0A reference number to associate with the specific error. Constructor for SecurityErrorEvent objects. Creates an Event object that contains information about security error events. Event objects are passed as parameters to event listeners. SECURITY_ERRORclone Creates a copy of the SecurityErrorEvent object and sets the value of each property to match that of the original.A new securityErrorEvent object with property values that match those of the original. flash.events:Event Creates a copy of the SecurityErrorEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the SecurityErrorEvent object.A string that contains all the properties of the SecurityErrorEvent object. String Returns a string that contains all the properties of the SecurityErrorEvent object. The string is in the following format:

[securityErrorEvent type=value bubbles=value cancelable=value text=value errorID=value] The errorId is only available in Adobe AIR

SECURITY_ERROR The SecurityErrorEvent.SECURITY_ERROR constant defines the value of the type property of a securityError event object.securityErrorString The SecurityErrorEvent.SECURITY_ERROR constant defines the value of the type property of a securityError event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe network object reporting the security error.textText to be displayed as an error message.
flash.net.FileReference.securityErrorflash.net.LocalConnection.securityErrorflash.net.NetConnection.securityErrorflash.net.Socket.securityErrorflash.net.URLLoader.securityErrorflash.net.URLStream.securityErrorflash.net.XMLSocket.securityError
UncaughtErrorEvent An UncaughtErrorEvent object is dispatched by an instance of the UncaughtErrorEvents class when an uncaught error occurs.flash.events:ErrorEvent An UncaughtErrorEvent object is dispatched by an instance of the UncaughtErrorEvents class when an uncaught error occurs. An uncaught error happens when an error is thrown outside of any try..catch blocks or when an ErrorEvent object is dispatched with no registered listeners. The uncaught error event functionality is often described as a "global error handler."

The UncaughtErrorEvents object that dispatches the event is associated with either a LoaderInfo object or a Loader object. Use the following properties to access an UncaughtErrorEvents instance:

  • LoaderInfo.uncaughtErrorEvents: to detect uncaught errors in code defined in the same SWF.
  • Loader.uncaughtErrorEvents: to detect uncaught errors in code defined in the SWF loaded by a Loader object.

When an uncaughtError event happens, even if the event is handled, execution does not continue in the call stack that caused the error. If the error is a synchronous error, any code remaining in the function where the error happened is not executed. Consequently, it is likely that when an uncaught error event happens, your application is in an unstable state. Since there can be many causes for an uncaught error, it is impossible to predict what functionality is available. For example, your application may be able to execute network operations or file operations. However, those operations aren't necessarily available.

When one SWF loads another, uncaughtError events bubble down and up again through the LoaderInfo heirarchy. For example, suppose A.swf loads B.swf using a Loader instance. If an uncaught error occurs in B.swf, an uncaughtError event is dispatched to LoaderInfo and Loader objects in the following sequence:

  1. (Capture phase) A.swf's LoaderInfo
  2. (Capture phase) Loader in A.swf
  3. (Target phase) B.swf's LoaderInfo
  4. (Bubble phase) Loader in A.swf
  5. (Bubble phase) A.swf's LoaderInfo

A Loader object's uncaughtErrorEvents property never dispatches an uncaughtErrorEvent in the target phase. It only dispatches the event in the capture and bubbling phases.

As with other event bubbling, calling stopPropagation() or stopImmediatePropagation() stops the event from being dispatched to any other listeners, with one important difference. A Loader object's UncaughtErrorEvents object is treated as a pair with the loaded SWF's LoaderInfo.uncaughtErrorEvents object for event propagation purposes. If a listener registered with one of those objects calls the stopPropagation() method, events are still dispatched to other listeners registered with that UncaughtErrorEvents object and to listeners registered with its partner UncaughtErrorEvents object before event propagation ends. The stopImmediatePropagation() method still prevents events from being dispatched to all additional listeners.

When content is running in a debugger version of the runtime, such as the debugger version of Flash Player or the AIR Debug Launcher (ADL), an uncaught error dialog appears when an uncaught error happens. For those runtime versions, the error dialog appears even when a listener is registered for the uncaughtError event. To prevent the dialog from appearing in that situation, call the UncaughtErrorEvent object's preventDefault() method.

If the content loaded by a Loader object is an AVM1 (ActionScript 2) SWF file, uncaught errors in the AVM1 SWF file do not result in an uncaughtError event. In addition, JavaScript errors in HTML content loaded in an HTMLLoader object (including a Flex HTML control) do not result in an uncaughtError event.

The following example demonstrates the use of an uncaught error event handler to detect uncaught errors in an ActionScript project. The example defines an uncaughtError event handler to detect uncaught errors. It also provides a button that, when clicked, throws an error that is caught by the uncaught error handler.

In the constructor, the code registers a listener for the uncaughtError event dispatched by the LoaderInfo object's uncaughtErrorEvents property.

In the uncaughtErrorHandler() method, the code checks the data type of the error property and responds accordingly.

package { import flash.display.Sprite; import flash.events.ErrorEvent; import flash.events.MouseEvent; import flash.events.UncaughtErrorEvent; public class UncaughtErrorEventExample extends Sprite { public function UncaughtErrorEventExample() { loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler); drawUI(); } private function uncaughtErrorHandler(event:UncaughtErrorEvent):void { if (event.error is Error) { var error:Error = event.error as Error; // do something with the error } else if (event.error is ErrorEvent) { var errorEvent:ErrorEvent = event.error as ErrorEvent; // do something with the error } else { // a non-Error, non-ErrorEvent type was thrown and uncaught } } private function drawUI():void { var btn:Sprite = new Sprite(); btn.graphics.clear(); btn.graphics.beginFill(0xFFCC00); btn.graphics.drawRect(0, 0, 100, 50); btn.graphics.endFill(); addChild(btn); btn.addEventListener(MouseEvent.CLICK, clickHandler); } private function clickHandler(event:MouseEvent):void { throw new Error("Gak!"); } } }
The following example is the Flex equivalent of the previous example, using an MXML document instead of an ActionScript class as the root content. <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" applicationComplete="applicationCompleteHandler();"> <fx:Script> <![CDATA[ import flash.events.ErrorEvent; import flash.events.MouseEvent; import flash.events.UncaughtErrorEvent; private function applicationCompleteHandler():void { loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler); } private function uncaughtErrorHandler(event:UncaughtErrorEvent):void { if (event.error is Error) { var error:Error = event.error as Error; // do something with the error } else if (event.error is ErrorEvent) { var errorEvent:ErrorEvent = event.error as ErrorEvent; // do something with the error } else { // a non-Error, non-ErrorEvent type was thrown and uncaught } } private function clickHandler(event:MouseEvent):void { throw new Error("Gak!"); } ]]> </fx:Script> <s:Button label="Cause Error" click="clickHandler(event);"/> </s:WindowedApplication> The following example demonstrates the use of an uncaught error event handler to detect uncaught errors in a loaded SWF. The example defines an uncaughtError event handler to detect uncaught errors.

In the constructor, the code creates a Loader object and registers a listener for the uncaughtError event dispatched by the Loader object's uncaughtErrorEvents property.

In the uncaughtErrorHandler() method, the code checks the data type of the error property and responds accordingly.

package { import flash.display.Loader; import flash.display.Sprite; import flash.events.ErrorEvent; import flash.events.UncaughtErrorEvent; import flash.net.URLRequest; public class LoaderUncaughtErrorEventExample extends Sprite { private var ldr:Loader; public function LoaderUncaughtErrorEventExample() { ldr = new Loader(); ldr.load(new URLRequest("child.swf")); ldr.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler); } private function uncaughtErrorHandler(event:UncaughtErrorEvent):void { if (event.error is Error) { var error:Error = event.error as Error; // do something with the error } else if (event.error is ErrorEvent) { var errorEvent:ErrorEvent = event.error as ErrorEvent; // do something with the error } else { // a non-Error, non-ErrorEvent type was thrown and uncaught } } } }
LoaderInfo.uncaughtErrorEventsLoader.uncaughtErrorEventsUncaughtErrorEventsuncaughtErrorflash.events:UncaughtErrorEvent:UNCAUGHT_ERRORflash.events:UncaughtErrorEventUncaughtErrorEvent Creates an UncaughtErrorEvent object that contains information about an uncaughtError event.typeStringunknownThe type of the event. bubblesBooleantrueDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleantrueDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. error_innullThe object associated with the error that was not caught or handled (an Error or ErrorEvent object under normal circumstances). Constructor for UncaughtErrorEvent objects. Creates an UncaughtErrorEvent object that contains information about an uncaughtError event. clone Creates a copy of the UncaughtErrorEvent object and sets the value of each property to match that of the original.A new UncaughtErrorEvent object with property values that match those of the original. flash.events:Event Creates a copy of the UncaughtErrorEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the UncaughtErrorEvent object.A string that contains all the properties of the UncaughtErrorEvent object. String Returns a string that contains all the properties of the UncaughtErrorEvent object. UNCAUGHT_ERROR Defines the value of the type property of an uncaughtError event object.uncaughtErrorString Defines the value of the type property of an uncaughtError event object.

This event has the following properties:

PropertyValuebubblestruecancelabletrue; cancelling the event prevents the uncaught error dialog from appearing in debugger runtime versionscurrentTargetThe object that is actively processing the Event object with an event listener.errorThe uncaught error.targetThe LoaderInfo object associated with the SWF where the error happened.textText error message.
error The error object associated with the uncaught error. The error object associated with the uncaught error. Typically, this object's data type is one of the following:
  • An Error instance (or one of its subclasses), if the uncaught error is a synchronous error created by a throw statement, such as an error that could have been caught using a try..catch block
  • An ErrorEvent instance (or one of its subclasses), if the uncaught error is an asynchronous error that dispatches an error event when the error happens

However, the error property can potentially be an object of any data type. ActionScript does not require a throw statement to be used only with Error objects. For example, the following code is legal both at compile time and run time:

throw new Sprite()

If that throw statement is not caught by a try..catch block, the throw statement triggers an uncaughtError event. In that case, the error property of the UncaughtErrorEvent object that's dispatched is the Sprite object that's constructed in the throw statement.

Consequently, in your uncaughtError listener, you should check the data type of the error property. The following example demonstrates this check:

function uncaughtErrorHandler(event:UncaughtErrorEvent):void { var message:String; if (event.error is Error) { message = Error(event.error).message; } else if (event.error is ErrorEvent) { message = ErrorEvent(event.error).text; } else { message = event.error.toString(); } }

If the error property contains an Error instance (or Error subclass), the available error information varies depending on the version of the runtime in which the content is running. The following functionality is only available when content is running in a debugger version of the runtime, such as the debugger version of Flash Player or the AIR Debug Launcher (ADL):

  • Error.getStackTrace() to get the call stack that led to the error. In non-debugger runtime versions, this method returns null. Note that call stack information is never available when the error property is an ErrorEvent instance.
  • Complete Error.message text. In non-debugger runtime versions, this property contains a short version of the error message, which is often a combination of the Error.errorID and Error.name properties.

All other properties and methods of the Error class are available in all runtime versions.

InvokeEvent The NativeApplication object of an AIR application dispatches an invoke event when the application is invoked.Dispatched by the NativeApplication object when an AIR application is invoked via the operating system. flash.events:Event The NativeApplication object of an AIR application dispatches an invoke event when the application is invoked.

The NativeApplication object always dispatches an invoke event when an application is launched, but the event may be dispatched at other times as well. For example, a running application dispatches an additional InvokeEvent when a user activates a file associated with the application.

Only a single instance of a particular application can be launched. Subsequent attempts to launch the application will result in a new invoke event dispatched by the NativeApplication object of the running instance. It is an application's responsibility to handle this event and take the appropriate action, such as opening a new application window to display the data in a file.

InvokeEvent objects are dispatched by the NativeApplication object (NativeApplication.nativeApplication). To receive invoke events, call the addEventListener() method of the NativeApplication object. When an event listener registers for an invoke event, it will also receive all invoke events that occurred before the registration. These earlier events are dispatched after the call to addEventListener() returns, but not necessarily before a new invoke event that might be might be dispatched after registration. Thus, you should not rely on dispatch order.

flash.events.BrowserInvokeEventflash.desktop.NativeApplicationinvokeflash.events:InvokeEvent:INVOKEflash.events:InvokeEventThe type constant for flash.events.InvokeEvent events. flash.desktop.NativeApplicationflash.desktop.InvokeEventReasonInvokeEvent The constructor function for the InvokeEvent class.typeStringThe type of the event, accessible as Event.type. bubblesBooleanfalseSet to false for an InvokeEvent object. cancelableBooleanfalseSet to false for an InvokeEvent object. dirflash.filesystem:FilenullThe directory that should be used to resolve any relative paths in the arguments array. argvArraynullAn array of arguments (strings) to pass to the application. reasonStringstandardthe cause of the event, either InvokeEventReason.LOGIN or InvokeEventReason.STANDARD. (This parameter is available as of AIR version 1.5.1.) The constructor function for the InvokeEvent class. flash.desktop.InvokeEventReasonclone Creates a new copy of this event.The copy of the event. flash.events:Event Creates a new copy of this event. INVOKE The InvokeEvent.INVOKE constant defines the value of the type property of an InvokeEvent object.invokeStringThe type constant for flash.events.InvokeEvent events. The InvokeEvent.INVOKE constant defines the value of the type property of an InvokeEvent object.

The InvokeEvent object has the following properties:

PropertiesValuesargumentsThe array of string arguments passed during this invocation.currentDirectorya File object representing the directory that should be used to resolve any relative paths in the arguments array.reasona code indicating whether the invoke event was dispatched because the application started automatically at login (InvokeEventReason.LOGIN), or for another reason (InvokeEventReason.STANDARD). Available as of AIR version 1.5.1.bubblesfalse.cancelablefalse; there is no default behavior to cancel.currentTargetIndicates the object that is actively processing this InvokeEvent object with an event listener.targetAlways the NativeApplication object.
flash.desktop.NativeApplicationflash.desktop.InvokeEventReason
arguments The array of string arguments passed during this invocation.Array The array of string arguments passed during this invocation. If this is a command line invocation, the array contains the command line arguments (excluding the process name).

Note: When multiple files are selected and opened on Mac® OS X, AIR dispatches a single invoke event containing the names of all the selected files in the arguments array. On Windows® and Linux, however, AIR dispatches a separate invoke event for each selected file containing only that filename in the arguments array.

currentDirectory The directory that should be used to resolve any relative paths in the arguments array.flash.filesystem:File The directory that should be used to resolve any relative paths in the arguments array.

If an application is started from the command line, this property is typically set to the current working directory of the command line shell from which the application was started. If an application is launched from the GUI shell, this is typically the file system root.

reason The reason for this InvokeEvent.String The reason for this InvokeEvent. This property indicates whether the application was launched manually by the user or automatically at login. Possible values are enumerated as constants in the InvokeEventReason class: InvokeEventReason constantMeaningLOGINLaunched automatically at at login.STANDARDLaunched for any other reason. flash.desktop.InvokeEventReason
ScreenMouseEvent The SystemTrayIcon object dispatches events of type ScreenMouseEvent in response to mouse interaction.Event object for ScreenMouseEvent events. flash.events:MouseEvent The SystemTrayIcon object dispatches events of type ScreenMouseEvent in response to mouse interaction.

The ScreenMouseEvent object extends the MouseEvent class to provide two additional properties, screenX and screenY, that report the mouse coordinates in relation to the primary desktop screen rather than an application window or stage.

flash.desktop.SystemTrayIconflash.display.Screenclickflash.events:ScreenMouseEvent:CLICKflash.events:ScreenMouseEventDispatched by a SystemTrayIcon object when the icon is clicked. mouseDownflash.events:ScreenMouseEvent:MOUSE_DOWNflash.events:ScreenMouseEventmouseUpflash.events:ScreenMouseEvent:MOUSE_UPflash.events:ScreenMouseEventrightClickflash.events:ScreenMouseEvent:RIGHT_CLICKflash.events:ScreenMouseEventrightMouseDownflash.events:ScreenMouseEvent:RIGHT_MOUSE_DOWNflash.events:ScreenMouseEventrightMouseUpflash.events:ScreenMouseEvent:RIGHT_MOUSE_UPflash.events:ScreenMouseEventScreenMouseEvent Creates a ScreenMouseEvent object that contains the mouse location in screen coordinates.typeString The type of the event. Event listeners can access this information through the inherited type property. bubblesBooleanfalseThe X position of the click in screen coordinates. cancelableBooleanfalseThe Y position of the click in screen coordinates. screenXNumberunknownSet to false since screen mouse events never bubble. screenYNumberunknownSet to false since there is no default behavior to cancel. ctrlKeyBooleanfalseOn Windows or Linux, indicates whether the Ctrl key was down when this event occurred. On Mac, indicates whether the Ctrl key or the Command key was down. altKeyBooleanfalseSet to true to indicate that the alt key was down when this event occured. shiftKeyBooleanfalseSet to true to indicate that the shift key was down when this event occured. buttonDownBooleanfalseSet to true to indicate that a mouse button was down when this event occured. commandKeyBooleanfalseIndicates whether the Command key was down (Mac only). controlKeyBooleanfalseIndicates whether the Ctrl or Control key was down. Constructor for ScreenMouseEvent objects. Creates a ScreenMouseEvent object that contains the mouse location in screen coordinates. flash.events.MouseEventflash.display.Screenclone Creates a copy of the ScreenMouseEvent object and sets the value of each property to match that of the original.A new ScreenMouseEvent object with property values that match those of the original. flash.events:Event Creates a copy of the ScreenMouseEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the ScreenMouseEvent object.A string that contains all the properties of the ScreenMouseEvent object. String Returns a string that contains all the properties of the ScreenMouseEvent object. The string is in the following format:

[ScreenMouseEvent type=value bubbles=value cancelable=value status=value]

CLICK The ScreenMouseEvent.CLICK constant defines the value of the type property of a click event object.clickStringDispatched by a SystemTrayIcon object when the icon is clicked. The ScreenMouseEvent.CLICK constant defines the value of the type property of a click event object.

This event has the following relevant properties:

PropertyValuebuttonDowntrue if the primary mouse button is pressed; false otherwise.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.shiftKeytrue if the Shift key is active; false if it is inactive.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.screenXThe horizontal coordinate at which the event occurred in screen coordinates.screenYThe vertical coordinate at which the event occurred in screen coordinates.targetThe SystemTrayIcon object under the pointing device.
MOUSE_DOWN The ScreenMouseEvent.MOUSE_DOWN constant defines the value of the type property of a mouseDown event object.mouseDownString The ScreenMouseEvent.MOUSE_DOWN constant defines the value of the type property of a mouseDown event object.

This event has the following relevant properties:

PropertyValuebuttonDowntrue if the primary mouse button is pressed; false otherwise.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.shiftKeytrue if the Shift key is active; false if it is inactive.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.screenXThe horizontal coordinate at which the event occurred in screen coordinates.screenYThe vertical coordinate at which the event occurred in screen coordinates.targetThe SystemTrayIcon object under the pointing device.
MOUSE_UP The ScreenMouseEvent.MOUSE_UP constant defines the value of the type property of a mouseUp event object.mouseUpString The ScreenMouseEvent.MOUSE_UP constant defines the value of the type property of a mouseUp event object.

This event has the following relevant properties:

PropertyValuebuttonDowntrue if the primary mouse button is pressed; false otherwise.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.shiftKeytrue if the Shift key is active; false if it is inactive.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.screenXThe horizontal coordinate at which the event occurred in screen coordinates.screenYThe vertical coordinate at which the event occurred in screen coordinates.targetThe SystemTrayIcon object under the pointing device.
RIGHT_CLICK The ScreenMouseEvent.RIGHT_CLICK constant defines the value of the type property of a rightClick event object.rightClickString The ScreenMouseEvent.RIGHT_CLICK constant defines the value of the type property of a rightClick event object.

This event has the following relevant properties:

PropertyValuebuttonDowntrue if the primary mouse button is pressed; false otherwise.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.shiftKeytrue if the Shift key is active; false if it is inactive.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.screenXThe horizontal coordinate at which the event occurred in screen coordinates.screenYThe vertical coordinate at which the event occurred in screen coordinates.targetThe SystemTrayIcon object under the pointing device.
RIGHT_MOUSE_DOWN The ScreenMouseEvent.RIGHT_MOUSE_DOWN constant defines the value of the type property of a rightMouseDown event object.rightMouseDownString The ScreenMouseEvent.RIGHT_MOUSE_DOWN constant defines the value of the type property of a rightMouseDown event object.

This event has the following relevant properties:

PropertyValuebuttonDowntrue if the primary mouse button is pressed; false otherwise.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.shiftKeytrue if the Shift key is active; false if it is inactive.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.screenXThe horizontal coordinate at which the event occurred in screen coordinates.screenYThe vertical coordinate at which the event occurred in screen coordinates.targetThe SystemTrayIcon object under the pointing device.
RIGHT_MOUSE_UP The ScreenMouseEvent.RIGHT_MOUSE_UP constant defines the value of the type property of a rightMouseUp event object.rightMouseUpString The ScreenMouseEvent.RIGHT_MOUSE_UP constant defines the value of the type property of a rightMouseUp event object.

This event has the following relevant properties:

PropertyValuebuttonDowntrue if the primary mouse button is pressed; false otherwise.ctrlKeytrue on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false.currentTargetThe object that is actively processing the Event object with an event listener.shiftKeytrue if the Shift key is active; false if it is inactive.commandKeytrue on the Mac if the Command key is active; false if it is inactive. Always false on Windows.controlKeytrue if the Ctrl or Control key is active; false if it is inactive.screenXThe horizontal coordinate at which the event occurred in screen coordinates.screenYThe vertical coordinate at which the event occurred in screen coordinates.targetThe SystemTrayIcon object under the pointing device.
screenX The X position of the click in screen coordinates.Number The X position of the click in screen coordinates. screenY The Y position of the click in screen coordinates.Number The Y position of the click in screen coordinates.
ContextMenuEvent An InteractiveObject dispatches a ContextMenuEvent object when the user opens or interacts with the context menu.Event objects for ContextMenuEvent events. flash.events:Event An InteractiveObject dispatches a ContextMenuEvent object when the user opens or interacts with the context menu. There are two types of ContextMenuEvent objects:
  • ContextMenuEvent.MENU_ITEM_SELECT
  • ContextMenuEvent.MENU_SELECT
The following example uses the ContextMenuEventExample class to remove the default context menu items from the Stage and add a new menu item that changes the color of a square on the Stage. The example carries out the following tasks:
  1. The myContextMenu property is declared and then assigned to a new ContextMenu object and the redRectangle property (of type Sprite) is declared.
  2. The removeDefaultItems() method is called. This method removes all built-in context menu items except Print.
  3. The addCustomMenuItems() method is called. This method places a Reverse Colors menu item in the defaultItems array by using the push() method of Array. A menuItemSelect event listener is added to the ContextMenuItem object and the associated method is called menuItemSelectHandler(). This method prints some trace() statements whenever the user selects Reverse Colors from the context menu. In addition the red square becomes black and the black text becomes red.
  4. Back in the constructor, a menuSelect event listener is added, along with the associated method menuSelectHandler(), which simply prints out three trace() statements every time an item in the context menu is selected.
  5. The constructor calls addChildren(), which draws a red square and adds it to the display list, which immediately displays the square.
  6. Finally, myContextMenu is assigned to the context menu of the redRectangle property, so that the custom context menu is displayed only when the mouse pointer is over the square.
package { import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; import flash.ui.ContextMenuBuiltInItems; import flash.events.ContextMenuEvent; import flash.display.Sprite; import flash.display.Shape; import flash.text.TextField; public class ContextMenuEventExample extends Sprite { private var myContextMenu:ContextMenu; private var menuLabel:String = "Reverse Colors"; private var textLabel:String = "Right Click"; private var redRectangle:Sprite; private var label:TextField; private var size:uint = 100; private var black:uint = 0x000000; private var red:uint = 0xFF0000; public function ContextMenuEventExample() { myContextMenu = new ContextMenu(); removeDefaultItems(); addCustomMenuItems(); myContextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, menuSelectHandler); addChildren(); redRectangle.contextMenu = myContextMenu; } private function addChildren():void { redRectangle = new Sprite(); redRectangle.graphics.beginFill(red); redRectangle.graphics.drawRect(0, 0, size, size); addChild(redRectangle); redRectangle.x = size; redRectangle.y = size; label = createLabel(); redRectangle.addChild(label); } private function removeDefaultItems():void { myContextMenu.hideBuiltInItems(); var defaultItems:ContextMenuBuiltInItems = myContextMenu.builtInItems; defaultItems.print = true; } private function addCustomMenuItems():void { var item:ContextMenuItem = new ContextMenuItem(menuLabel); myContextMenu.customItems.push(item); item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemSelectHandler); } private function menuSelectHandler(event:ContextMenuEvent):void { trace("menuSelectHandler: " + event); } private function menuItemSelectHandler(event:ContextMenuEvent):void { trace("menuItemSelectHandler: " + event); var textColor:uint = (label.textColor == black) ? red : black; var bgColor:uint = (label.textColor == black) ? black : red; redRectangle.graphics.clear(); redRectangle.graphics.beginFill(bgColor); redRectangle.graphics.drawRect(0, 0, size, size); label.textColor = textColor; } private function createLabel():TextField { var txtField:TextField = new TextField(); txtField.text = textLabel; return txtField; } } }
ContextMenu classContextMenuItem classmenuItemSelectflash.events:ContextMenuEvent:MENU_ITEM_SELECTflash.events:ContextMenuEventflash.ui.ContextMenuItem.menuItemSelectmenuSelectflash.events:ContextMenuEvent:MENU_SELECTflash.events:ContextMenuEventflash.ui.ContextMenu.menuSelectContextMenuEvent Creates an Event object that contains specific information about menu events.typeString The type of the event. Possible values are:
  • ContextMenuEvent.MENU_ITEM_SELECT
  • ContextMenuEvent.MENU_SELECT
bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. mouseTargetflash.display:InteractiveObjectnullThe display list object on which the user right-clicked to display the context menu. This could be the contextMenuOwner or one of its display list descendants. contextMenuOwnerflash.display:InteractiveObjectnullThe display list object to which the menu is attached. This could be the mouseTarget or one of its ancestors in the display list. Constructor for ContextMenuEvent objects.
Creates an Event object that contains specific information about menu events. Event objects are passed as parameters to event listeners.
ContextMenuEvent.MENU_ITEM_SELECTContextMenuEvent.MENU_SELECT
clone Creates a copy of the ContextMenuEvent object and sets the value of each property to match that of the original.A new ContextMenuEvent object with property values that match those of the original. flash.events:Event Creates a copy of the ContextMenuEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the ContextMenuEvent object.A string that contains all the properties of the ContextMenuEvent object. String Returns a string that contains all the properties of the ContextMenuEvent object. The string is in the following format:

[ContextMenuEvent type=value bubbles=value cancelable=value ... contextMenuOwner=value]

MENU_ITEM_SELECT Defines the value of the type property of a menuItemSelect event object.menuItemSelectString Defines the value of the type property of a menuItemSelect event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.contextMenuOwnerThe display list object to which the menu is attached.currentTargetThe object that is actively processing the Event object with an event listener.mouseTargetThe display list object on which the user right-clicked to display the context menu.targetThe ContextMenuItem object that has been selected. 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.
flash.ui.ContextMenuItem.menuItemSelect
MENU_SELECT Defines the value of the type property of a menuSelect event object.menuSelectString Defines the value of the type property of a menuSelect event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.contextMenuOwnerThe display list object to which the menu is attached.currentTargetThe object that is actively processing the Event object with an event listener.mouseTargetThe display list object on which the user right-clicked to display the context menu.targetThe ContextMenu object that is about to be displayed. 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.
flash.ui.ContextMenu.menuSelect
contextMenuOwner The display list object to which the menu is attached.flash.display:InteractiveObject The display list object to which the menu is attached. This could be the mouse target (mouseTarget) or one of its ancestors in the display list. isMouseTargetInaccessible Indicates whether the mouseTarget property was set to null for security reasons.Boolean Indicates whether the mouseTarget property was set to null for security reasons. If the nominal value of menuTarget would be a reference to a DisplayObject in another security sandbox, then menuTarget is set to null unless there is permission in both directions across this sandbox boundary. Permission is established by calling Security.allowDomain() from a SWF file, or providing a policy file from the server of an image file, and setting the LoaderContext.checkPolicyFile flag when loading the image. ContextMenuEvent.mouseTargetSecurity.allowDomain()LoaderContext.checkPolicyFilemouseTarget The display list object on which the user right-clicked to display the context menu.flash.display:InteractiveObject The display list object on which the user right-clicked to display the context menu. This could be the display list object to which the menu is attached (contextMenuOwner) or one of its display list descendants.

The value of this property can be null in two circumstances: if there no mouse target, for example when you mouse over something from the background; or there is a mouse target, but it is in a security sandbox to which you don't have access. Use the isMouseTargetInaccessible() property to determine which of these reasons applies.

ContextMenuEvent.isMouseTargetInaccessible
DRMAuthenticateEvent A NetStream object dispatchs a DRMAuthenticateEvent object when attempting to play digital rights management (DRM) encrypted content that requires a user credential for authentication.Event objects for DRM-enabled objects. flash.events:Event A NetStream object dispatchs a DRMAuthenticateEvent object when attempting to play digital rights management (DRM) encrypted content that requires a user credential for authentication.

The DRMAuthenticateEvent handler is responsible for gathering the required credentials (such as the user name, password, and type) and passing the values to the NetStream.setDRMAuthenticationCredentials() method for authentication. Each AIR application must provide some mechanism for obtaining user credentials. For example, the application could provide a user with a simple user interface to enter the username and password values, and optionally the type value as well.

If user authentication failed, the application will retry authentication and dispatch a new DRMAuthenticateEvent event for the NetStream object.

package { import flash.display.Sprite; import flash.events.AsyncErrorEvent; import flash.events.NetStatusEvent; import flash.events.DRMAuthenticateEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; public class DRMAuthenticateEventExample extends Sprite { var videoURL:String = "Video.flv"; var videoConnection:NetConnection; var videoStream:NetStream; var video:Video = new Video(); public function DRMAuthenticateEventExample() { videoConnection = new NetConnection(); videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); videoConnection.connect(null); } private function connectStream():void { videoStream = new NetStream(videoConnection); videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); videoStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, drmAuthenticateEventHandler); video.attachNetStream(videoStream); videoStream.play(videoURL); addChild(video); } private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case "NetConnection.Connect.Success": connectStream(); break; case "NetStream.Play.StreamNotFound": trace("Unable to locate video: " + videoURL); break; } } private function asyncErrorHandler(event:AsyncErrorEvent):void { // ignore AsyncErrorEvent events. } private function drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void { videoStream.setDRMAuthenticationCredentials("User", "password", "drm"); } } }
DRMAuthenticateEvent.DRM_AUTHENTICATEflash.net.drm.DRMManagerdrmAuthenticateflash.events:DRMAuthenticateEvent:AUTHENTICATION_TYPE_DRMflash.events:DRMAuthenticateEventflash.net.NetStream.drmAuthenticateDRMAuthenticateEvent.authenticationTypedrmAuthenticateflash.events:DRMAuthenticateEvent:AUTHENTICATION_TYPE_PROXYflash.events:DRMAuthenticateEventflash.net.NetStream.drmAuthenticateDRMAuthenticateEvent.authenticationTypedrmAuthenticateflash.events:DRMAuthenticateEvent:DRM_AUTHENTICATEflash.events:DRMAuthenticateEventflash.net.NetStream.drmAuthenticateDRMAuthenticateEvent Creates an Event object that contains specific information about DRM authentication events.typeString The type of the event. Event listeners can access this information through the inherited type property. There is only one type of DRMAuthenticate event: DRMAuthenticateEvent.DRM_AUTHENTICATE. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. headerStringThe encrypted content file header provided by the server. userPromptString A prompt for a user name credential, provided by the server. passPromptStringA prompt for a password credential, provided by the server. urlPromptStringA prompt for a URL to display, provided by the server. authenticationTypeStringIndicates whether the supplied credentials are for authenticating against the Flash Media Rights Management Server (FMRMS) or a proxy server. netstreamflash.net:NetStreamnullThe NetStream object that initiated this event. Creates an Event object that contains specific information about DRM authentication events. Event objects are passed as parameters to event listeners. clone Creates a copy of the DRMAuthenticateEvent object and sets the value of each property to match that of the original.A new DRMAuthenticateEvent object with property values that match those of the original. flash.events:Event Creates a copy of the DRMAuthenticateEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the DRMAuthenticateEvent object.A string that contains all the properties of the DRMAuthenticateEvent object. String Returns a string that contains all the properties of the DRMAuthenticateEvent object. The string is in the following format:

[DRMAuthenticateEvent type=value bubbles=value cancelable=value eventPhase=value header=value usernamePrompt=value passwordPrompt=value urlPrompt=value] authenticationType=value

AUTHENTICATION_TYPE_DRM The DRMAuthenticateEvent.AUTHENTICATION_TYPE_DRM constant defines the value of the authenticationType property of a DRMAuthenticateEvent object.drmString The DRMAuthenticateEvent.AUTHENTICATION_TYPE_DRM constant defines the value of the authenticationType property of a DRMAuthenticateEvent object.

This event has the following properties:

PropertyValueauthenticationTypeIndicates whether the supplied credentials are for authenticating against the Flash Media Rights Management Server (FMRMS) or a proxy server.bubblesfalsecancelablefalse; there is no default behavior to cancel.headerThe encrypted content file header provided by the server.netstreamThe NetStream object that initiated this event.passwordPromptA prompt for a password credential, provided by the server.targetThe NetStream object.urlPromptA prompt for a URL to display, provided by the server.usernamePromptA prompt for a user name credential, provided by the server.
flash.net.NetStream.drmAuthenticateDRMAuthenticateEvent.authenticationType
AUTHENTICATION_TYPE_PROXY The DRMAuthenticateEvent.AUTHENTICATION_TYPE_PROXY constant defines the value of the authenticationType property of a DRMAuthenticateEvent object.proxyString The DRMAuthenticateEvent.AUTHENTICATION_TYPE_PROXY constant defines the value of the authenticationType property of a DRMAuthenticateEvent object.

This event has the following properties:

PropertyValueauthenticationTypeIndicates whether the supplied credentials are for authenticating against the Flash Media Rights Management Server (FMRMS) or a proxy server.bubblesfalsecancelablefalse; there is no default behavior to cancel.headerThe encrypted content file header provided by the server.netstreamThe NetStream object that initiated this event.passwordPromptA prompt for a password credential, provided by the server.targetThe NetStream object.urlPromptA prompt for a URL to display, provided by the server.usernamePromptA prompt for a user name credential, provided by the server.
flash.net.NetStream.drmAuthenticateDRMAuthenticateEvent.authenticationType
DRM_AUTHENTICATE The DRMAuthenticateEvent.DRM_AUTHENTICATE constant defines the value of the type property of a DRMAuthenticateEvent object.drmAuthenticateString The DRMAuthenticateEvent.DRM_AUTHENTICATE constant defines the value of the type property of a DRMAuthenticateEvent object.

This event has the following properties:

PropertyValueauthenticationTypeIndicates whether the supplied credentials are for authenticating against the Flash Media Rights Management Server (FMRMS) or a proxy server.bubblesfalsecancelablefalse there is no default behavior to cancel.headerThe encrypted content file header provided by the server.netstreamThe NetStream object that initiated this event.passwordPromptA prompt for a password credential, provided by the server.targetThe NetStream object.urlPromptA prompt for a URL to display, provided by the server.usernamePromptA prompt for a user name credential, provided by the server.
flash.net.NetStream.drmAuthenticate
authenticationType Indicates whether the supplied credentials are for authenticating against Flash Media Rights Management Server (FMRMS) or a proxy server.String Indicates whether the supplied credentials are for authenticating against Flash Media Rights Management Server (FMRMS) or a proxy server. For example, the "proxy" option allows the application to authenticate against a proxy server if an enterprise requires such a step before the user can access the Internet. Unless anonymous authentication is used, after the proxy authentication, the user still needs to authenticate against FMRMS in order to obtain the voucher and play the content. You can use setDRMAuthenticationcredentials() a second time, with "drm" option, to authenticate against FMRMS. header The encrypted content file header provided by the server.String The encrypted content file header provided by the server. It contains information about the context of the encrypted content. netstream The NetStream object that initiated this event.flash.net:NetStream The NetStream object that initiated this event. passwordPrompt A prompt for a password credential, provided by the server.String A prompt for a password credential, provided by the server. The string can include instruction for the type of password required. urlPrompt A prompt for a URL string, provided by the server.String A prompt for a URL string, provided by the server. The string can provide the location where the username and password will be sent. usernamePrompt A prompt for a user name credential, provided by the server.String A prompt for a user name credential, provided by the server. The string can include instruction for the type of user name required. For example, a content provider may require an e-mail address as the user name.
StorageVolumeChangeEvent The StorageVolumeInfo.storageVolumeInfo object dispatches a StorageVolumeChangeEvent event object when a storage volume is mounted or unmounted.flash.events:Event The StorageVolumeInfo.storageVolumeInfo object dispatches a StorageVolumeChangeEvent event object when a storage volume is mounted or unmounted. There are two types of StorageVolumeChangeEvent: storageVolumeMount and storageVolumeUnmount.

On Linux, the StorageVolumeInfo object only dispatches storageVolumeMount and storageVolumeUnmount events for physical devices. It does not dispatch events when the user mounts or unmounts volumes over a network.

Some devices, such as some digital cameras and phones, appear in the StorageVolumeInfo.getStorageVolumes() array, but they do not dispatch StorageVolumeChangeEvent objects when mounted or unmounted.

flash.filesystem.StorageVolumeInfostorageVolumeMountflash.events:StorageVolumeChangeEvent:STORAGE_VOLUME_MOUNTflash.events:StorageVolumeChangeEventflash.filesystem.StorageVolumeInfostorageVolumeUnountflash.events:StorageVolumeChangeEvent:STORAGE_VOLUME_UNMOUNTflash.events:StorageVolumeChangeEventflash.filesystem.StorageVolumeInfoStorageVolumeChangeEvent Creates a StorageVolumeChangeEvent object to pass as an argument to event listeners.typeString The type of the event, accessible in the type property. The StorageVolumeChangeEvent class defines two event types, the storageVolumeMount event, represented by the StorageVolumeChangeEvent.STORAGE_VOLUME_MOUNT constant, and the storageVolumeUnmount event, represented by the StorageVolumeChangeEvent.STORAGE_VOLUME_UNMOUNT constant, bubblesBooleanfalse Determines whether the event object participates in the bubbling stage of the event flow. The default value is false. cancelableBooleanfalseDetermines whether the Event object can be cancelled. The default value is false. pathflash.filesystem:FilenullThe name of the storage volume. volumeflash.filesystem:StorageVolumenullThe File object representing the storage volume. Used to create new StorageVolumeChangeEvent object. Creates a StorageVolumeChangeEvent object to pass as an argument to event listeners. flash.errors.SQLErrorflash.events.ErrorEvent.ERRORclone Duplicates an instance of an Event subclass.A new Event object that is identical to the original. flash.events:Event Duplicates an instance of an Event subclass.

Returns a new Event object that is a copy of the original instance of the Event object. You do not normally call clone(); the EventDispatcher class calls it automatically when you redispatch an event—that is, when you call dispatchEvent(event) from a handler that is handling event.

The new Event object includes all the properties of the original.

When creating your own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when listeners handle the redispatched event.

In this example, PingEvent is a subclass of Event and therefore implements its own version of clone().

class PingEvent extends Event { var URL:String; public override function clone():Event { return new PingEvent(type, bubbles, cancelable, URL); } }
toString Returns a string containing all the properties of the Event object.A string containing all the properties of the Event object. String Returns a string containing all the properties of the Event object. The string is in the following format:

[Event type=value bubbles=value cancelable=value]

STORAGE_VOLUME_MOUNT The StorageVolumeChangeEvent.VOLUME_MOUNT constant defines the value of the type property of a StorageVolumeChangeEvent when a volume is mounted.storageVolumeMountString The StorageVolumeChangeEvent.VOLUME_MOUNT constant defines the value of the type property of a StorageVolumeChangeEvent when a volume is mounted.

The event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe StorageVolumeChangeEvent object.fileA File object representing the storage volume.nameThe name of the storage volume.targetThe StorageVolumeChangeEvent object.type"storageVolumeMount"
flash.filesystem.StorageVolumeInfo
STORAGE_VOLUME_UNMOUNT The StorageVolumeChangeEvent.VOLUME_MOUNT constant defines the value of the type property of a StorageVolumeChangeEvent when a volume is unmounted.storageVolumeUnmountString The StorageVolumeChangeEvent.VOLUME_MOUNT constant defines the value of the type property of a StorageVolumeChangeEvent when a volume is unmounted.

The event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe StorageVolumeChangeEvent object.fileA File object representing the storage volume.nameThe name of the storage volume.targetThe StorageVolumeChangeEvent object.type"storageVolumeUnmount"
flash.filesystem.StorageVolumeInfo
rootDirectory A File object corresponding to the root directory of the mounted volume.flash.filesystem:File A File object corresponding to the root directory of the mounted volume. If the volume has been unmounted (if the event type is storageVolumeUnmount, this property is set to null. flash.filesystem.FilestorageVolume A StorageVolume object containing information about a mounted volume.flash.filesystem:StorageVolume A StorageVolume object containing information about a mounted volume. This property is null for an unmounted volume (for an storageVolumeUnmount event). flash.filesystem.StorageVolume
SQLEvent Adobe AIR dispatches SQLEvent objects when one of the operations performed by a SQLConnection or SQLStatement instance completes successfully.flash.events:Event Adobe AIR dispatches SQLEvent objects when one of the operations performed by a SQLConnection or SQLStatement instance completes successfully. flash.data.SQLConnectionflash.data.SQLStatementanalyzeflash.events:SQLEvent:ANALYZEflash.events:SQLEventflash.data.SQLConnection.analyze()attachflash.events:SQLEvent:ATTACHflash.events:SQLEventflash.data.SQLConnection.attach()beginflash.events:SQLEvent:BEGINflash.events:SQLEventflash.data.SQLConnection.begin()cancelflash.events:SQLEvent:CANCELflash.events:SQLEventflash.data.SQLConnection.cancel()closeflash.events:SQLEvent:CLOSEflash.events:SQLEventflash.data.SQLConnection.close()commitflash.events:SQLEvent:COMMITflash.events:SQLEventflash.data.SQLConnection.commit()compactflash.events:SQLEvent:COMPACTflash.events:SQLEventflash.data.SQLConnection.compact()deanalyzeflash.events:SQLEvent:DEANALYZEflash.events:SQLEventflash.data.SQLConnection.deanalyze()detachflash.events:SQLEvent:DETACHflash.events:SQLEventflash.data.SQLConnection.detach()openflash.events:SQLEvent:OPENflash.events:SQLEventflash.data.SQLConnection.open()flash.data.SQLConnection.openAsync()reencryptflash.events:SQLEvent:REENCRYPTflash.events:SQLEventflash.data.SQLConnection.reencrypt()releaseSavepointflash.events:SQLEvent:RELEASE_SAVEPOINTflash.events:SQLEventflash.data.SQLConnection.releaseSavepoint()resultflash.events:SQLEvent:RESULTflash.events:SQLEventflash.data.SQLStatement.execute()flash.data.SQLStatement.next()flash.data.SQLStatement.getResult()rollbackToSavepointflash.events:SQLEvent:ROLLBACK_TO_SAVEPOINTflash.events:SQLEventflash.data.SQLConnection.rollbackToSavepoint()rollbackflash.events:SQLEvent:ROLLBACKflash.events:SQLEventflash.data.SQLConnection.rollback()schemaflash.events:SQLEvent:SCHEMAflash.events:SQLEventflash.data.SQLConnection.loadSchema()setSavepointflash.events:SQLEvent:SET_SAVEPOINTflash.events:SQLEventflash.data.SQLConnection.setSavepoint()SQLEvent Creates a SQLEvent object to pass as a parameter to event listeners.typeString The type of the event, available in the type property. bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. cancelableBooleanfalseDetermines whether the Event object can be canceled. The default value is false. Used to create new SQLEvent object. Creates a SQLEvent object to pass as a parameter to event listeners. clone Creates a copy of the SQLEvent object and sets the value of each property to match that of the original.A new SQLEvent object with property values that match those of the original. flash.events:Event Creates a copy of the SQLEvent object and sets the value of each property to match that of the original. ANALYZE The SQLEvent.ANALYZE constant defines the value of the type property of an analyze event object.analyzeString The SQLEvent.ANALYZE constant defines the value of the type property of an analyze event object. This type of event is dispatched when a SQLConnection.analyze() method call completes successfully. The analyze event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.analyze()ATTACH The SQLEvent.ATTACH constant defines the value of the type property of an attach event object.attachString The SQLEvent.ATTACH constant defines the value of the type property of an attach event object. This type of event is dispatched when a SQLConnection.attach() method call completes successfully. The attach event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.attach()BEGIN The SQLEvent.BEGIN constant defines the value of the type property of a begin event object.beginString The SQLEvent.BEGIN constant defines the value of the type property of a begin event object. This type of event is dispatched when a SQLConnection.begin() method call completes successfully. The begin event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.begin()CANCEL The SQLEvent.CANCEL constant defines the value of the type property of a cancel event object.cancelString The SQLEvent.CANCEL constant defines the value of the type property of a cancel event object. This type of event is dispatched when a SQLConnection.cancel() method call completes successfully. The cancel event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection or SQLStatement object that performed the operation. flash.data.SQLConnection.cancel()CLOSE The SQLEvent.CLOSE constant defines the value of the type property of a close event object.closeString The SQLEvent.CLOSE constant defines the value of the type property of a close event object. This type of event is dispatched when a SQLConnection.close() method call completes successfully. The close event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.close()COMMIT The SQLEvent.COMMIT constant defines the value of the type property of a commit event object.commitString The SQLEvent.COMMIT constant defines the value of the type property of a commit event object. This type of event is dispatched when a SQLConnection.commit() method call completes successfully. The commit event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.commit()COMPACT The SQLEvent.COMPACT constant defines the value of the type property of a compact event object.compactString The SQLEvent.COMPACT constant defines the value of the type property of a compact event object. This type of event is dispatched when a SQLConnection.compact() method call completes successfully. The compact event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.compact()DEANALYZE The SQLEvent.DEANALYZE constant defines the value of the type property of a deanalyze event object.deanalyzeString The SQLEvent.DEANALYZE constant defines the value of the type property of a deanalyze event object. This type of event is dispatched when a SQLConnection.deanalyze() method call completes successfully. The deanalyze event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.deanalyze()DETACH The SQLEvent.DETACH constant defines the value of the type property of a detach event object.detachString The SQLEvent.DETACH constant defines the value of the type property of a detach event object. This type of event is dispatched when a SQLConnection.detach() method call completes successfully. PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.detach()OPEN The SQLEvent.OPEN constant defines the value of the type property of a open event object.openString The SQLEvent.OPEN constant defines the value of the type property of a open event object. This type of event is dispatched when a SQLConnection.open() or SQLConnection.openAsync() method call completes successfully. The open event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.open()flash.data.SQLConnection.openAsync()REENCRYPT The SQLEvent.REENCRYPT constant defines the value of the type property of a reencrypt event object.reencryptString The SQLEvent.REENCRYPT constant defines the value of the type property of a reencrypt event object. This type of event is dispatched when a SQLConnection.reencrypt() method call completes successfully. The reencrypt event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.reencrypt()RELEASE_SAVEPOINT The SQLEvent.RELEASE_SAVEPOINT constant defines the value of the type property of a releaseSavepoint event object.releaseSavepointString The SQLEvent.RELEASE_SAVEPOINT constant defines the value of the type property of a releaseSavepoint event object. This type of event is dispatched when a SQLConnection.releaseSavepoint() method call completes successfully. The releaseSavepoint event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.releaseSavepoint()RESULT The SQLEvent.RESULT constant defines the value of the type property of a result event object.resultString The SQLEvent.RESULT constant defines the value of the type property of a result event object. Dispatched when either the SQLStatement.execute() method or SQLStatement.next() method completes successfully. Once the SQLEvent.RESULT event is dispatched the SQLStatement.getResult() method can be called to access the result data. The result event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLStatement object that performed the operation. flash.data.SQLStatement.execute()flash.data.SQLStatement.next()flash.data.SQLStatement.getResult()ROLLBACK_TO_SAVEPOINT The SQLEvent.ROLLBACK_TO_SAVEPOINT constant defines the value of the type property of a rollbackToSavepoint event object.rollbackToSavepointString The SQLEvent.ROLLBACK_TO_SAVEPOINT constant defines the value of the type property of a rollbackToSavepoint event object. This type of event is dispatched when a SQLConnection.rollbackToSavepoint() method call completes successfully. The rollbackToSavepoint event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.rollbackToSavepoint()ROLLBACK The SQLEvent.ROLLBACK constant defines the value of the type property of a rollback event object.rollbackString The SQLEvent.ROLLBACK constant defines the value of the type property of a rollback event object. This type of event is dispatched when a SQLConnection.rollback() method call completes successfully. The rollback event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.rollback()SCHEMA The SQLEvent.SCHEMA constant defines the value of the type property of a schema event object.schemaString The SQLEvent.SCHEMA constant defines the value of the type property of a schema event object. Dispatched when the SQLConnection.loadSchema() method completes successfully. Once the SQLEvent.SCHEMA event is dispatched the SQLConnection.getSchemaResult() method can be used to get the schema information. The schema event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.loadSchema()SET_SAVEPOINT The SQLEvent.SET_SAVEPOINT constant defines the value of the type property of a setSavepoint event object.setSavepointString The SQLEvent.SET_SAVEPOINT constant defines the value of the type property of a setSavepoint event object. This type of event is dispatched when a SQLConnection.setSavepoint() method call completes successfully. The setSavepoint event has the following properties: PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the event object with an event listener.targetThe SQLConnection object that performed the operation. flash.data.SQLConnection.setSavepoint()DRMErrorEvent The DRMErrorEvent class provides information about errors that occur when playing digital rights management (DRM) encrypted files.Event objects for DRM-enabled objects. flash.events:ErrorEvent The DRMErrorEvent class provides information about errors that occur when playing digital rights management (DRM) encrypted files.

The runtime dispatches a DRMErrorEvent object when a NetStream object, trying to play a digital rights management (DRM) encrypted file, encounters a DRM-related error. For example, a DRMErrorEvent object is dispatched when the content provider does not support the viewing application, or when the user authorization fails, possibly because the user has not purchased the content.

In the case of invalid user credentials, the DRMAuthenticateEvent object handles the error by repeatedly dispatching until the user enters valid credentials, or the application denies further attempts. The application should listen to any other DRM error events in order to detect, identify, and handle the DRM-related errors.

This class provides properties containing the object throwing the exception, the error code, and, where applicable, a suberror code and text message containing information related to the error. For a description of DRM-related error codes, see the Runtime error codes. The DRM-related error codes start at error 3300.

package { import flash.display.Sprite; import flash.events.AsyncErrorEvent; import flash.events.NetStatusEvent; import flash.events.DRMErrorEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; public class DRMVideoExample extends Sprite { var videoURL:String = "Video.flv"; var videoConnection:NetConnection; var videoStream:NetStream; var video:Video = new Video(); public function DRMVideoExample() { videoConnection = new NetConnection(); videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); videoConnection.connect(null); } private function connectStream():void { videoStream = new NetStream(videoConnection); videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); videoStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); videoStream.addEventListener(DRMErrorEvent.DRM_ERROR, drmErrorEventHandler); video.attachNetStream(videoStream); videoStream.play(videoURL); addChild(video); } private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case "NetConnection.Connect.Success": connectStream(); break; case "NetStream.Play.StreamNotFound": trace("Unable to locate video: " + videoURL); break; } } private function asyncErrorHandler(event:AsyncErrorEvent):void { // ignore AsyncErrorEvent events. } private function drmErrorEventHandler(event:DRMErrorEvent):void { trace(event.toString()); } } }
flash.net.NetStreamDRMErrorEvent.DRM_ERRORRuntime error codesdrmErrorflash.events:DRMErrorEvent:DRM_ERRORflash.events:DRMErrorEventflash.net.NetStream.drmErrorDRMErrorEvent Creates an Event object that contains specific information about DRM error events.typeStringunknown The type of the event. Event listeners can access this information through the inherited type property. There is only one type of DRMAuthenticate event: DRMAuthenticateEvent.DRM_AUTHENTICATE. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. inErrorDetailStringWhere applicable, the specific syntactical details of the error. inErrorCodeint0The major error code. insubErrorIDint0The minor error ID. inMetadataflash.net.drm:DRMContentDatanullinSystemUpdateNeededBooleanfalseinDrmUpdateNeededBooleanfalse Creates an Event object that contains specific information about DRM error events. Event objects are passed as parameters to event listeners. clone Creates a copy of the DRMErrorEvent object and sets the value of each property to match that of the original.A new DRMErrorEvent object with property values that match those of the original. flash.events:Event Creates a copy of the DRMErrorEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the DRMErrorEvent object.A string that contains all the properties of the DRMErrorEvent object. String Returns a string that contains all the properties of the DRMErrorEvent object. The string is in the following format:

[DRMErrorEvent type=value bubbles=value cancelable=value eventPhase=value errroID=value subErrorID=value text=value

DRM_ERROR The DRMErrorEvent.DRM_ERROR constant defines the value of the type property of a drmError event object.drmErrorString The DRMErrorEvent.DRM_ERROR constant defines the value of the type property of a drmError event object.

This event has the following properties:

PropertyValuebubblesfalsecancelablefalse; there is no default behavior to cancel.errorIDA numerical error code assigned to the problem.subErrorIDAn error code that indicates more detailed information about the underlying problem.targetThe NetStream object.
flash.net.NetStream.drmError
contentData The DRMContentData for the media file.flash.net.drm:DRMContentData The DRMContentData for the media file.

You can use the object referenced by the contentData property to retrieve the related DRM voucher from the DRMManager voucher cache. The voucher properties describe the license available to the user and may explain why the DRM-protected content cannot be viewed.

drmUpdateNeeded Indicates whether a DRM update is needed to play the DRM-protected content.Boolean Indicates whether a DRM update is needed to play the DRM-protected content. subErrorID An error ID that indicates more detailed information about the underlying problem.int An error ID that indicates more detailed information about the underlying problem. systemUpdateNeeded Indicates whether a system update is needed to play the DRM-protected content.Boolean Indicates whether a system update is needed to play the DRM-protected content.
EventPhase The EventPhase class provides values for the eventPhase property of the Event class.Object The EventPhase class provides values for the eventPhase property of the Event class. Event classEventDispatcher classAT_TARGET The target phase, which is the second phase of the event flow.2uint The target phase, which is the second phase of the event flow. BUBBLING_PHASE The bubbling phase, which is the third phase of the event flow.3uint The bubbling phase, which is the third phase of the event flow. CAPTURING_PHASE The capturing phase, which is the first phase of the event flow.1uint The capturing phase, which is the first phase of the event flow. FocusEvent An object dispatches a FocusEvent object when the user changes the focus from one object in the display list to another.Event objects for Focus events. flash.events:Event An object dispatches a FocusEvent object when the user changes the focus from one object in the display list to another. There are four types of focus events:
  • FocusEvent.FOCUS_IN
  • FocusEvent.FOCUS_OUT
  • FocusEvent.KEY_FOCUS_CHANGE
  • FocusEvent.MOUSE_FOCUS_CHANGE
The following example uses the FocusEventExample and CustomSprite classes to show how focus can be used in conjunction with items drawn on the Stage to capture events and print information. This example carries out the following tasks:
  1. It declares the properties child (of type Sprite) and childCount (of type uint).
  2. A for loop creates five light blue squares at (0,0). It begins by assigning child to a new CustomSprite instance. Each time a CustomSprite object is created, the following happens:
    • The size property of type uint is set to 50 pixels and bgColor is set to light blue.
    • The buttonMode and useHandCursor properties of the Sprite class are set to true within the constructor.
    • An event listener of type click is instantiated, along with the associated subscriber clickHandler(). The subscriber method creates a local variable target of type Sprite and assigns it whichever box was clicked. The Stage's focus is then assigned to target.
    • The draw() method is called, which creates a 50 x 50 pixel square by calling the beginFill(), drawRect(), and endFill() methods of the Graphics class and the instance properties.
  3. In the for loop, the configureListeners() method is called, which instantiates three event listeners/subscribers:
    • focusIn/focusInHandler() is dispatched after the click event for whichever display list object (box) is clicked.
    • focusOut/focusOutHandler() is dispatched when another box is clicked or if the focus leaves the Stage (for example, by clicking outside Flash Player).
    • keyFocusChange/keyFocusChangeHandler() is dispatched if you use the Tab key or the left-arrow or right-arrow keys to select a display list object. The keyFocusChangeHandler() method traps the left-arrow and right-arrow keys, however, and calls the preventDefault() method to disable them.
  4. In the for loop, each square is added to the display list and displayed (all in the same area) by means of addChild().
  5. The constructor then calls refreshLayout(), which distributes the orange squares across the top (y = 0) of the display with 5 pixels separating each square.
package { import flash.display.Sprite; import flash.display.DisplayObject; import flash.events.FocusEvent; import flash.events.IEventDispatcher; public class FocusEventExample extends Sprite { private var gutter:uint = 5; private var childCount:uint = 5; public function FocusEventExample() { var child:Sprite; for(var i:uint; i < childCount; i++) { child = new CustomSprite(); configureListeners(child); addChild(child); } refreshLayout(); } private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(FocusEvent.FOCUS_IN, focusInHandler); dispatcher.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler); dispatcher.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); dispatcher.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler); } private function refreshLayout():void { var ln:uint = numChildren; var child:DisplayObject = getChildAt(0); var lastChild:DisplayObject = child; for(var i:uint = 1; i < ln; i++) { child = getChildAt(i); child.x = lastChild.x + lastChild.width + gutter; lastChild = child; } } private function focusInHandler(event:FocusEvent):void { var target:CustomSprite = CustomSprite(event.target); trace("focusInHandler: " + target.name); } private function focusOutHandler(event:FocusEvent):void { var target:CustomSprite = CustomSprite(event.target); trace("focusOutHandler: " + target.name); } private function keyFocusChangeHandler(event:FocusEvent):void { if(event.keyCode == 39 || event.keyCode == 37){ event.preventDefault() } var target:CustomSprite = CustomSprite(event.target); trace("keyFocusChangeHandler: " + target.name); } private function mouseFocusChangeHandler(event:FocusEvent):void { var target:CustomSprite = CustomSprite(event.target); trace("mouseFocusChangeHandler: " + target.name); } } } import flash.display.Sprite; import flash.events.MouseEvent; class CustomSprite extends Sprite { private var size:uint = 50; private var bgColor:uint = 0x00CCFF; public function CustomSprite() { buttonMode = true; useHandCursor = true; addEventListener(MouseEvent.CLICK, clickHandler); draw(size, size); } private function draw(w:uint, h:uint):void { graphics.beginFill(bgColor); graphics.drawRect(0, 0, w, h); graphics.endFill(); } private function clickHandler(event:MouseEvent):void { var target:Sprite = Sprite(event.target); trace("clickHandler: " + target.name); stage.focus = target; } }
focusInflash.events:FocusEvent:FOCUS_INflash.events:FocusEventflash.display.InteractiveObject.focusInfocusOutflash.events:FocusEvent:FOCUS_OUTflash.events:FocusEventflash.display.InteractiveObject.focusOutkeyFocusChangeflash.events:FocusEvent:KEY_FOCUS_CHANGEflash.events:FocusEventflash.display.InteractiveObject.keyFocusChangemouseFocusChangeflash.events:FocusEvent:MOUSE_FOCUS_CHANGEflash.events:FocusEventflash.display.InteractiveObject.mouseFocusChangeFocusEvent Creates an Event object with specific information relevant to focus events.typeString The type of the event. Possible values are: FocusEvent.FOCUS_IN, FocusEvent.FOCUS_OUT, FocusEvent.KEY_FOCUS_CHANGE, and FocusEvent.MOUSE_FOCUS_CHANGE. bubblesBooleantrue Determines whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. relatedObjectflash.display:InteractiveObjectnullIndicates the complementary InteractiveObject instance that is affected by the change in focus. For example, when a focusIn event occurs, relatedObject represents the InteractiveObject that has lost focus. shiftKeyBooleanfalseIndicates whether the Shift key modifier is activated. keyCodeuint0Indicates the code of the key pressed to trigger a keyFocusChange event. directionStringnoneIndicates from which direction the target interactive object is being activated. Set to FocusDirection.NONE (the default value) for all events other than focusIn. Constructor for FocusEvent objects. Creates an Event object with specific information relevant to focus events. Event objects are passed as parameters to event listeners. FOCUS_INFOCUS_OUTKEY_FOCUS_CHANGEMOUSE_FOCUS_CHANGEflash.display.FocusDirectionclone Creates a copy of the FocusEvent object and sets the value of each property to match that of the original.A new FocusEvent object with property values that match those of the original. flash.events:Event Creates a copy of the FocusEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the FocusEvent object.A string that contains all the properties of the FocusEvent object. String Returns a string that contains all the properties of the FocusEvent object. The string is in the following format:

[FocusEvent type=value bubbles=value cancelable=value relatedObject=value shiftKey=value] keyCode=value]

FOCUS_IN Defines the value of the type property of a focusIn event object.focusInString Defines the value of the type property of a focusIn event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.keyCode0; applies only to keyFocusChange events.relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus.shiftKeyfalse; applies only to keyFocusChange events.targetThe InteractiveObject instance that has just received focus. 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. directionThe direction from which focus was assigned. This property reports the value of the direction parameter of the assignFocus() method of the stage. If the focus changed through some other means, the value will always be FocusDirection.NONE. Applies only to focusIn events. For all other focus events the value will be FocusDirection.NONE.
flash.display.InteractiveObject.focusIn
FOCUS_OUT Defines the value of the type property of a focusOut event object.focusOutString Defines the value of the type property of a focusOut event object.

This event has the following properties:

PropertyValuebubblestruecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.keyCode0; applies only to keyFocusChange events.relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus.shiftKeyfalse; applies only to keyFocusChange events.targetThe InteractiveObject instance that has just lost focus. 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.
flash.display.InteractiveObject.focusOut
KEY_FOCUS_CHANGE Defines the value of the type property of a keyFocusChange event object.keyFocusChangeString Defines the value of the type property of a keyFocusChange event object.

This event has the following properties:

PropertyValuebubblestruecancelabletrue; call the preventDefault() method to cancel default behavior.currentTargetThe object that is actively processing the Event object with an event listener.keyCodeThe key code value of the key pressed to trigger a keyFocusChange event.relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus.shiftKeytrue if the Shift key modifier is activated; false otherwise.targetThe InteractiveObject instance that currently has focus. 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.
flash.display.InteractiveObject.keyFocusChange
MOUSE_FOCUS_CHANGE Defines the value of the type property of a mouseFocusChange event object.mouseFocusChangeString Defines the value of the type property of a mouseFocusChange event object.

This event has the following properties:

PropertyValuebubblestruecancelabletrue; call the preventDefault() method to cancel default behavior.currentTargetThe object that is actively processing the Event object with an event listener.keyCode0; applies only to keyFocusChange events.relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus.shiftKeyfalse; applies only to keyFocusChange events.targetThe InteractiveObject instance that currently has focus. 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.
flash.display.InteractiveObject.mouseFocusChange
direction Specifies direction of focus for a focusIn event.String Specifies direction of focus for a focusIn event. flash.display.FocusDirectionflash.display.Stage.assignFocus()isRelatedObjectInaccessible If true, the relatedObject property is set to null for reasons related to security sandboxes.Boolean If true, the relatedObject property is set to null for reasons related to security sandboxes. If the nominal value of relatedObject is a reference to a DisplayObject in another sandbox, relatedObject is set to null unless there is permission in both directions across this sandbox boundary. Permission is established by calling Security.allowDomain() from a SWF file, or by providing a policy file from the server of an image file, and setting the LoaderContext.checkPolicyFile property when loading the image. FocusEvent.relatedObjectSecurity.allowDomain()LoaderContext.checkPolicyFilekeyCode The key code value of the key pressed to trigger a keyFocusChange event.uint The key code value of the key pressed to trigger a keyFocusChange event. relatedObject A reference to the complementary InteractiveObject instance that is affected by the change in focus.flash.display:InteractiveObject A reference to the complementary InteractiveObject instance that is affected by the change in focus. For example, when a focusOut event occurs, the relatedObject represents the InteractiveObject instance that has gained focus.

The value of this property can be null in two circumstances: if there no related object, or there is a related object, but it is in a security sandbox to which you don't have access. Use the isRelatedObjectInaccessible() property to determine which of these reasons applies.

FocusEvent.isRelatedObjectInaccessible
shiftKey Indicates whether the Shift key modifier is activated, in which case the value is true.Boolean Indicates whether the Shift key modifier is activated, in which case the value is true. Otherwise, the value is false. This property is used only if the FocusEvent is of type keyFocusChange.
GesturePhase The GesturePhase class is an enumeration class of constant values for use with the GestureEvent, PressAndTapGestureEvent, and TransformGestureEvent classes.Object The GesturePhase class is an enumeration class of constant values for use with the GestureEvent, PressAndTapGestureEvent, and TransformGestureEvent classes. Use these values to track the beginning, progress, and end of a touch gesture (such as moving several fingers across a touch enabled screen) so your application can respond to individual stages of user contact. Some gestures (swipe and two-finger tap gestures) do not have multiple phases, and set the event object phase property to all. The following example shows event handling for the GESTURE_ROTATE events. While the user performs a rotation gesture on the touch-enabled device, mySprite rotates and myTextField populates with the current phase. Multitouch.inputMode = MultitouchInputMode.GESTURE; var mySprite = new Sprite(); mySprite.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate ); mySprite.graphics.beginFill(0x336699); mySprite.graphics.drawRect(0, 0, 100, 80); var myTextField = new TextField(); myTextField.y = 200; addChild(mySprite); addChild(myTextField); function onRotate(evt:TransformGestureEvent):void { evt.target.rotation -= 45; if (evt.phase==GesturePhase.BEGIN) { myTextField.text = "Begin"; } if (evt.phase==GesturePhase.UPDATE) { myTextField.text = "Update"; } if (evt.phase==GesturePhase.END) { myTextField.text = "End"; } } flash.events.GestureEventflash.events.TransformGestureEventflash.events.PressAndTapGestureEventALL A single value that encompasses all phases of simple gestures like two-finger-tap or swipe.allString A single value that encompasses all phases of simple gestures like two-finger-tap or swipe. For gestures that set the event object phase property to all (swipe and two-finger tap gestures), the phase value is always all once the event is dispatched. flash.events.GestureEventflash.events.TransformGestureEventflash.events.PressAndTapGestureEventBEGIN The beginning of a new gesture (such as touching a finger to a touch enabled screen).beginString The beginning of a new gesture (such as touching a finger to a touch enabled screen). flash.events.GestureEventflash.events.TransformGestureEventflash.events.PressAndTapGestureEventEND The completion of a gesture (such as lifting a finger off a touch enabled screen).endString The completion of a gesture (such as lifting a finger off a touch enabled screen). flash.events.GestureEventflash.events.TransformGestureEventflash.events.PressAndTapGestureEventUPDATE The progress of a gesture (such as moving a finger across a touch enabled screen).updateString The progress of a gesture (such as moving a finger across a touch enabled screen). flash.events.GestureEventflash.events.TransformGestureEventflash.events.PressAndTapGestureEventBrowserInvokeEvent The NativeApplication object of an AIR application dispatches a browserInvoke event when the application is invoked as the result of a SWF file in the browser using the browser invocation feature.Dispatched by the NativeApplication object when an AIR application is invoked through a web browser. flash.events:Event The NativeApplication object of an AIR application dispatches a browserInvoke event when the application is invoked as the result of a SWF file in the browser using the browser invocation feature. The NativeApplication object also dispatches a browserInvoke event when a user instantiates the seamless installation feature in the browser and the SWF file in the browser passes an array to the arguments parameter of the launchApplication() method of the air.swf file. (For details, see "Distributing, installing and running AIR applications" in the AIR developer's guide.)

Browser invocation is permitted only if an application specifies the following in the application descriptor file:

<allowBrowserInvocation>true</allowBrowserInvocation>

If the application is not running, the NativeApplication object dispatches both an InvokeEvent event and a browserInvoke event when launched from the browser. Otherwise, if the application is already running, the NativeApplication object dispatches only a browserInvoke event when launched from the browser.

If the application is launched as the result of a seamless installation from the browser (with the user choosing to launch upon installation), the NativeApplication object dispatches a BrowserInvoke event only if arguments were passed (via the SWF file in the browser passing an array to the arguments parameter of the installApplication() method of the air.swf file). For details, see "Distributing, installing, and running AIR applications" in the AIR developer's guide.

Like the invokeEvent events, browserInvokeEvent events are dispatched by the NativeApplication object (NativeApplication.nativeApplication). To receive browserInvoke events, call the addEventListener() method of the NativeApplication object. When an event listener registers for a browserInvoke event, it will also receive all browserInvoke events that occurred before the registration. These are dispatched after the call to addEventListener() returns, but not necessarily before other browserInvoke events that might be received after registration. This allows you to handle browserInvoke events that have occurred before your initialization code is executed (such as when the application was initially invoked from the browser). Keep in mind that if you add an event listener later in execution (after application initialization), it still receives all browserInvoke events that have occurred since the application started.

flash.events.InvokeEventflash.desktop.NativeApplicationinvokeflash.events:BrowserInvokeEvent:BROWSER_INVOKEflash.events:BrowserInvokeEventflash.desktop.NativeApplicationBrowserInvokeEvent The constructor function for the BrowserInvokeEvent class.typeStringThe type of the event, accessible as Event.type. bubblesBooleanSet to false for a BrowserInvokeEvent object. cancelableBooleanSet to false for a BrowserInvokeEvent object. argumentsArrayAn array of arguments (strings) to pass to the application. sandboxTypeStringThe sandbox type for the content in the browser. securityDomainStringThe security domain for the content in the browser. isHTTPSBooleanWhether the content in the browser uses the HTTPS URL scheme. isUserEventBooleanWhether the browser invocation was the result of a user event. The constructor function for the BrowserInvokeEvent class. Generally, developers do not call the BrowserInvokeEvent() constructor directly. Only the runtime should create a BrowserInvokeEvent object. clone Creates a new copy of this event.The copy of the event. flash.events:Event Creates a new copy of this event. BROWSER_INVOKE The BrowserInvokeEvent.BROWSER_INVOKE constant defines the value of the type property of a BrowserInvokeEvent object.browserInvokeString The BrowserInvokeEvent.BROWSER_INVOKE constant defines the value of the type property of a BrowserInvokeEvent object.

The BrowserInvokeEvent object has the following properties:

PropertiesValuesargumentsThe array of string arguments passed during this invocation.sandBoxTypeA string representing the the sandbox type for the content in the browser (either Security.APPLICATION, Security.LOCAL_TRUSTED, Security.LOCAL_WITH_FILE, Security.LOCAL_LOCAL_WITH_NETWORK, or Security.REMOTE).securityDomainA string representing the the security domain for the content in the browser (such as "www.example.com").isHTTPSWhether the browser content uses the HTTPS URL scheme (true) or not (false)isUserEventWhether the browser invocation resulted from a user event (always true in AIR 1.0).bubblesNo.cancelablefalse; There is no default behavior to cancel.currentTargetIndicates the object that is actively processing this InvokeEvent object with an event listener.targetAlways the NativeApplication object.
flash.desktop.NativeApplication
arguments An array of arguments (strings) to pass to the application.Array An array of arguments (strings) to pass to the application. isHTTPS Whether the content in the browser uses the HTTPS URL scheme (true) or not (false).Boolean Whether the content in the browser uses the HTTPS URL scheme (true) or not (false). isUserEvent Whether the browser invocation resulted in a user event (such as a mouse click).Boolean Whether the browser invocation resulted in a user event (such as a mouse click). In AIR 1.0, this is always set to true; AIR requires a user event to initiate a call to the browser invocation feature. sandboxType The sandbox type for the content in the browser.String The sandbox type for the content in the browser. This can be set to one of the following values:
  • Security.APPLICATION — The content is in the application security sandbox.
  • Security.LOCAL_TRUSTED — The content is in the local-trusted security sandbox.
  • Security.LOCAL_WITH_FILE — The content is in the local-with-filesystem security sandbox.
  • Security.LOCAL_WITH_NETWORK — The content is in the local-with-networking security sandbox.
  • Security.REMOTE — The content is in a remote (network) domain
flash.system.Security.sandboxType
securityDomain The security domain for the content in the browser, such as "www.adobe.com" or "www.example.org".String The security domain for the content in the browser, such as "www.adobe.com" or "www.example.org". This property is set only for content in the remote security sandbox (for content from a network domain), not for content in a local or application security sandbox.
OutputProgressEvent A FileStream object dispatches OutputProgressEvent objects as pending asynchronous file write operations are performed.Event objects for output progress events (for asynchronous file write operations). flash.events:Event A FileStream object dispatches OutputProgressEvent objects as pending asynchronous file write operations are performed. There is one type of output progress event: OutputProgressEvent.OUTPUT_PROGRESS. flash.filesystem.FileStreamoutputProgressflash.events:OutputProgressEvent:OUTPUT_PROGRESSflash.events:OutputProgressEventflash.filesystem.FileStreamOutputProgressEvent Creates an Event object that contains information about output progress events.typeString The type of the event. There is only one type of error event: OutputProgressEvent.OUTPUT_PROGRESS. bubblesBooleanfalse Determines whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseDetermines whether the Event object can be canceled. bytesPendingNumber0The number of bytes not yet written. bytesTotalNumber0The total number of bytes written or with pending writes. Constructor for OutputProgressEvent objects. Creates an Event object that contains information about output progress events. Event objects are passed as parameters to event listeners. clone Creates a copy of the OutputProgressEvent object and sets each property's value to match that of the original.A new OutputProgressEvent object with property values that match those of the original. flash.events:Event Creates a copy of the OutputProgressEvent object and sets each property's value to match that of the original. toString Returns a string that contains all the properties of the OutputProgressEvent object.A string that contains all the properties of the OutputProgressEvent object. String Returns a string that contains all the properties of the OutputProgressEvent object. The string is in the following format:

[OutputProgressEvent type=value bubbles=value cancelable=value eventPhase=value bytesPending=value bytesTotal=value]

OUTPUT_PROGRESS Defines the value of the type property of an outputProgress event object.outputProgressString Defines the value of the type property of an outputProgress event object.

This event has the following properties:

PropertyValuebubblesfalsebytesPendingThe number of bytes remaining to be written at the time the listener processes the event.bytesTotalThe total number of bytes that ultimately will be written if the write process succeeds.cancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe FileStream object reporting progress.
flash.filesystem.FileStream
bytesPending The number of bytes not yet written when the listener processes the event.Number The number of bytes not yet written when the listener processes the event. bytesTotal The total number of bytes written so far, plus the number of pending bytes to be written.Number The total number of bytes written so far, plus the number of pending bytes to be written.
StageOrientationEvent A Stage object dispatches a StageOrientationEvent object when the orientation of the stage changes.flash.events:Event A Stage object dispatches a StageOrientationEvent object when the orientation of the stage changes. This can occur when the device is rotated, when the user opens a slide-out keyboard, or when the setAspectRatio() method of the Stage is called.

There are two types of StageOrientationEvent event: The orientationChanging (StageOrientationEvent.ORIENTATION_CHANGING), is dispatched before the screen changes to a new orientation. Calling the preventDefault() method of the event object dispatched for orientationChanging prevents the stage from changing orientation. The orientationChange (StageOrientationEvent.ORIENTATION_CHANGE), is dispatched after the screen changes to a new orientation.

Note: If the autoOrients property is false, then the stage orientation does not change when a device is rotated. Thus, StageOrientationEvents are only dispatched for device rotation when autoOrients is true.

Stage.deviceOrientationStage.autoOrientsorientationChangeflash.events:StageOrientationEvent:ORIENTATION_CHANGEflash.events:StageOrientationEventflash.display.StagedeviceOrientationStageOrientationEvent Creates a StageOrientationEvent object with specific information relevant to stage orientation events.typeString The type of the event: StageOrientationEvent.ORIENTATION_CHANGE bubblesBooleanfalse Indicates whether the Event object participates in the bubbling stage of the event flow. cancelableBooleanfalseIndicates whether the Event object can be canceled. beforeOrientationStringnullIndicates the orientation before the change. afterOrientationStringnullIndicates the orientation after the change. Creates a StageOrientationEvent object with specific information relevant to stage orientation events. Event objects are passed as parameters to event listeners. Generally you do not create this event using the constructor function. Instead, you add an event listener on the Stage object to detect these events as they occur. clone Creates a copy of the StageOrientationEvent object and sets the value of each property to match that of the original.A new StageOrientationEvent object with property values that match those of the original. flash.events:Event Creates a copy of the StageOrientationEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the StageOrientationEvent object.A string that contains all the properties of the StageOrientationEvent object. String Returns a string that contains all the properties of the StageOrientationEvent object. The string has the following format:

[StageOrientationEvent type=value bubbles=value cancelable=value beforeDisplayState=value afterDisplayState=value]

ORIENTATION_CHANGE The ORIENTATION_CHANGE constant defines the value of the type property of a orientationChange event object.orientationChangeString The ORIENTATION_CHANGE constant defines the value of the type property of a orientationChange event object. This event has the following properties: PropertiesValuesafterOrientationThe new orientation of the stage.beforeOrientationThe old orientation of the stage.targetThe Stage object that dispatched the orientation change. bubblestruecurrentTargetIndicates the object that is actively processing the Event object with an event listener.cancelablefalse; it is too late to cancel the change. flash.display.StagedeviceOrientationORIENTATION_CHANGING The ORIENTATION_CHANGING constant defines the value of the type property of a orientationChanging event object.orientationChangingString The ORIENTATION_CHANGING constant defines the value of the type property of a orientationChanging event object.

Important: ORIENTATION_CHANGING events are not dispatched on Android devices.

This event has the following properties: PropertiesValuesafterOrientationThe new orientation of the stage.beforeOrientationThe old orientation of the stage.targetThe Stage object that dispatched the orientation change. bubblestruecurrentTargetIndicates the object that is actively processing the Event object with an event listener.cancelabletrue.
afterOrientation The orientation of the stage after the change.String The orientation of the stage after the change. beforeOrientation The orientation of the stage before the change.String The orientation of the stage before the change.
ActivityEvent A Camera or Microphone object dispatches an ActivityEvent object whenever a camera or microphone reports that it has become active or inactive.Event objects for ActivityEvent events. flash.events:Event A Camera or Microphone object 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. 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); } } } ActivityEvent.ACTIVITYactivityflash.events:ActivityEvent:ACTIVITYflash.events:ActivityEventflash.media.Camera.activityflash.media.Microphone.activityActivityEvent Creates an event object that contains information about activity events.typeString 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. bubblesBooleanfalseDetermines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. cancelableBooleanfalseDetermines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. activatingBooleanfalseIndicates whether the device is activating (true) or deactivating (false). Event listeners can access this information through the activating property. Constructor for ActivityEvent objects. Creates an event object that contains information about activity events. Event objects are passed as parameters to Event listeners. ActivityEvent.ACTIVITYclone Creates a copy of an ActivityEvent object and sets the value of each property to match that of the original.A new ActivityEvent object with property values that match those of the original. flash.events:Event Creates a copy of an ActivityEvent object and sets the value of each property to match that of the original. toString Returns a string that contains all the properties of the ActivityEvent object.A string that contains all the properties of the ActivityEvent object. 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]

ACTIVITY The ActivityEvent.ACTIVITY constant defines the value of the type property of an activity event object.activityString The ActivityEvent.ACTIVITY constant defines the value of the type property of an activity event object.

This event has the following properties:

PropertyValueactivatingtrue if the device is activating or false if it is deactivating.bubblesfalsecancelablefalse; there is no default behavior to cancel.currentTargetThe object that is actively processing the Event object with an event listener.targetThe object beginning or ending a session, such as a Camera or Microphone object.
flash.media.Camera.activityflash.media.Microphone.activity
activating Indicates whether the device is activating (true) or deactivating (false).Boolean Indicates whether the device is activating (true) or deactivating (false).