| Package | flash.events |
| Class | public class DataEvent |
| Inheritance | DataEvent TextEvent Event Object |
Event.COMPLETE event.
There is only one type of data event: DataEvent.DATA.
View the examples.
See also
| flash.net.XMLSocket, DataEvent.DATA |
| Property | Defined by | ||
|---|---|---|---|
![]() | ACTIVATE : String = "activate" [static]
Dispatched when Flash Player gains operating system focus and becomes active.
| Event | |
![]() | ADDED : String = "added" [static]
Dispatched when a display object is added to the display list.
| Event | |
![]() | CANCEL : String = "cancel" [static]
Dispatched when a file upload or download is cancelled by the user.
| Event | |
![]() | CHANGE : String = "change" [static]
Dispatched after a control's value is modified.
| Event | |
![]() | CLOSE : String = "close" [static]
Dispatched by an Socket or XMLSocket object after a network connection is closed.
| Event | |
![]() | COMPLETE : String = "complete" [static]
Dispatched when data has loaded successfully.
| Event | |
![]() | CONNECT : String = "connect" [static]
Dispatched when a network connection has been established.
| Event | |
| DATA : String = "data" [static]
Flash Player dispatches the
data event after raw data has finished loading. | DataEvent | ||
![]() | DEACTIVATE : String = "deactivate" [static]
Dispatched when Flash Player loses operating system focus and is
becoming inactive.
| Event | |
![]() | ENTER_FRAME : String = "enterFrame" [static]
Dispatched when the playhead is entering a new
frame.
| Event | |
![]() | ID3 : String = "id3" [static]
Dispatched by a Sound object when ID3 data is available for an MP3 sound.
| Event | |
![]() | INIT : String = "init" [static]
Dispatched by a LoaderInfo object when the properties and methods of a loaded SWF file are
accessible.
| Event | |
![]() | LINK : String = "link" [static]
Flash Player dispatches the
link event when a user clicks a hyperlink in an
HTML-enabled text field, where the URL begins with "event:". | TextEvent | |
![]() | MOUSE_LEAVE : String = "mouseLeave" [static]
Dispatched by the Stage object when the mouse pointer moves out of the Flash Player
window area.
| Event | |
![]() | OPEN : String = "open" [static]
Dispatched by a LoaderInfo, URLLoader, URLStream or FileReference object when a network
operation starts.
| Event | |
![]() | REMOVED : String = "removed" [static]
Dispatched when a display object is about to be removed from the display list.
| Event | |
![]() | RENDER : String = "render" [static]
Dispatched when the display list is about to be updated and rendered.
| Event | |
![]() | RESIZE : String = "resize" [static]
Dispatched when
scaleMode property of the Stage object is set to
StageScaleMode.NO_SCALE and the SWF file has been resized. | Event | |
![]() | SCROLL : String = "scroll" [static]
Dispatched by a TextField object after the user scrolls.
| Event | |
![]() | SELECT : String = "select" [static]
Dispatched by a FileReference object when an item has been selected.
| Event | |
![]() | SOUND_COMPLETE : String = "soundComplete" [static]
Dispatched by a Sound object when a sound has finished playing.
| Event | |
![]() | TAB_CHILDREN_CHANGE : String = "tabChildrenChange" [static]
Dispatched by an InteractiveObject instance when the value of the object's
tabChildren flag changes. | Event | |
![]() | TAB_ENABLED_CHANGE : String = "tabEnabledChange" [static]
Dispatched by an InteractiveObject instance when the the object's
tabEnabled flag changes. | Event | |
![]() | TAB_INDEX_CHANGE : String = "tabIndexChange" [static]
Dispatched by an InteractiveObject instance when the
value of the object's
tabIndex property changes. | Event | |
![]() | TEXT_INPUT : String = "textInput" [static]
Flash Player dispatches the
textInput event when a user enters one or more
characters of text. | TextEvent | |
![]() | UNLOAD : String = "unload" [static]
Dispatched by a LoaderInfo object whenever a loaded object is removed using the
unload()
method of the Loader object, or when a second load is performed by the same Loader object and the
orignal content is removed prior to the load beginning. | Event | |
| Property | Defined by | ||
|---|---|---|---|
![]() | bubbles : Boolean
Indicates whether an event is a bubbling event.
| Event | |
![]() | cancelable : Boolean
Indicates whether the behavior associated with the event can be prevented.
| Event | |
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
![]() | currentTarget : Object
Indicates the object that is actively processing the Event object with an event listener.
| Event | |
| data : String
The raw data loaded into Flash Player.
| DataEvent | ||
![]() | eventPhase : uint
Indicates the current phase in the event flow.
| Event | |
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
![]() | target : Object
Indicates the event target.
| Event | |
![]() | text : String
For a
textInput event, the character or sequence of characters
entered by the user. | TextEvent | |
![]() | type : String
Indicates the type of event.
| Event | |
| Function | Defined by | ||
|---|---|---|---|
|
Creates an event object that contains information about data events.
| DataEvent | ||
|
Creates a copy of the DataEvent object and sets the value of each property to match that of the
original.
| DataEvent | ||
![]() |
A utility function that you use to implement the
toString() method in your custom Event class. | Event | |
![]() |
Indicates whether an object has a specified property defined.
| Object | |
![]() |
This method checks whether
preventDefault() has been called on the event and
returns true if preventDefault() has been called and
false otherwise. | Event | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | |
![]() |
Cancels an event's default behavior if that behavior can be cancelled.
| Event | |
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
![]() |
Prevents processing of any event listeners in the current node and any subsequent nodes in
the event flow.
| Event | |
![]() |
Prevents processing of any event listeners in nodes subsequent to the current node in the
event flow.
| Event | |
|
Returns a string that contains all the properties of the DataEvent object.
| DataEvent | ||
![]() |
Returns the primitive value of the specified object.
| Object | |
public static const DATA:String = "data"
data event after raw data has finished loading.
This event has the following characteristics:
| Properties | Values |
|---|---|
target | The Loader, URLLoader, or URLStream receiving data.
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. |
bubbles | No. |
currentTarget | Indicates the object that is actively processing the Event object with an event listener. |
cancelable | No. There is no default behavior to cancel. |
| flash.net.XMLSocket |
data:String [read-write] public function get data():String
public function set data(value:String):void
public function DataEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, data:String = "")
type:String — 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.
|
|
bubbles:Boolean (default = false) — Determines whether the Event object participates in the bubbling phase of the
event flow. Event listeners can access this information through the inherited
bubbles property.
|
|
cancelable:Boolean (default = false) — Determines whether the Event object can be cancelled. Event listeners can
access this information through the inherited cancelable property.
|
|
data:String (default = "") — The raw data loaded into Flash Player. Event listeners can access this information
through the data property.
|
| flash.net.XMLSocket, DataEvent.DATA |
public override function clone():Event
Event —
A new DataEvent object with property values that match those of the original.
|
public override function toString():String
[DataEvent type=value bubbles=value cancelable=value
data=value]
Returns
String —
A string that contains all the properties of the DataEvent object.
|
yourDomain] port 8080. An event listener is attached to the XMLSocket
object that listens for data events, which are dispatched whenever raw data
is received.
Notes:
securityError event in this example, you need to compile the SWF file with "Local playback security" set
to "Access network only".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);
}
}
}
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/labs/flashauthoringpreview/flash/events/DataEvent.html