ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
fl.events 

RSLEvent  - AS3 Flash

Packagefl.events
Classpublic class RSLEvent
InheritanceRSLEvent Inheritance Event Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

The RSLEvent class defines events dispatched by RSLPreloader. These events indicate progress in downloading RSLs, including information on the number of files and the number of bytes loaded. When a custom event preloading loop is used, and the RSLPreloader code is generated automatically by Flash authoring, these events are dispatched by the main timeline. In this case, use addEventListener without needing to reference the RSLPreloader.

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedbubbles : Boolean
[read-only] Indicates whether an event is a bubbling event.
Event
  bytesLoaded : int
[read-only] Returns the total number of downloaded bytes in files that have successfully downloaded.
RSLEvent
  bytesTotal : int
[read-only] Returns the total number of downloaded bytes in files that have downloaded, successful or not.
RSLEvent
 Inheritedcancelable : Boolean
[read-only] Indicates whether the behavior associated with the event can be prevented.
Event
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheritedcurrentTarget : Object
[read-only] The object that is actively processing the Event object with an event listener.
Event
 InheritedeventPhase : uint
[read-only] The current phase in the event flow.
Event
  rslsFailed : int
[read-only] Returns the number of files that have failed to download.
RSLEvent
  rslsLoaded : int
[read-only] Returns the number of files that have downloaded successfully.
RSLEvent
  rslsTotal : int
[read-only] Returns the total number of files that have downloaded, successfully or not.
RSLEvent
 Inheritedtarget : Object
[read-only] The event target.
Event
 Inheritedtype : String
[read-only] The type of event.
Event
Public Methods
 MethodDefined By
  
RSLEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, rslsLoaded:int = 0, rslsFailed:int = 0, rslsTotal:int = 0, bytesLoaded:int = 0, bytesTotal:int = 0)
Creates an Event object with specific information relevant to RSL events.
RSLEvent
 Inherited
Duplicates an instance of an Event subclass.
Event
 Inherited
formatToString(className:String, ... arguments):String
A utility function for implementing the toString() method in custom ActionScript 3.0 Event classes.
Event
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Checks whether the preventDefault() method has been called on the event.
Event
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Cancels an event's default behavior if that behavior can be canceled.
Event
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.
Event
 Inherited
Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.
Event
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns a string containing all the properties of the Event object.
Event
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  RSL_LOAD_COMPLETE : String = "rslLoadComplete"
[static] Event dispatched by RSLPreloader when all RSLs have successfully downloading.
RSLEvent
  RSL_PROGRESS : String = "rslProgress"
[static] Event dispatched by RSLPreloader to indicate progress in downloading RSL files.
RSLEvent
Property Detail

bytesLoaded

property
bytesLoaded:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

Returns the total number of downloaded bytes in files that have successfully downloaded.



Implementation
    public function get bytesLoaded():int

bytesTotal

property 
bytesTotal:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

Returns the total number of downloaded bytes in files that have downloaded, successful or not.



Implementation
    public function get bytesTotal():int

rslsFailed

property 
rslsFailed:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

Returns the number of files that have failed to download.



Implementation
    public function get rslsFailed():int

rslsLoaded

property 
rslsLoaded:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

Returns the number of files that have downloaded successfully.



Implementation
    public function get rslsLoaded():int

rslsTotal

property 
rslsTotal:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

Returns the total number of files that have downloaded, successfully or not.



Implementation
    public function get rslsTotal():int
Constructor Detail

RSLEvent

()Constructor
public function RSLEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, rslsLoaded:int = 0, rslsFailed:int = 0, rslsTotal:int = 0, bytesLoaded:int = 0, bytesTotal:int = 0)

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

Creates an Event object with specific information relevant to RSL events.

Parameters
type:String — The type of the event. Possible values are: RSLEvent.RSL_LOAD_COMPLETE and RSLEvent.RSL_PROGRESS.
 
bubbles:Boolean (default = false) — Determines whether the Event object participates in the bubbling stage of the event flow.
 
cancelable:Boolean (default = false) — Determines whether the Event object can be canceled.
 
rslsLoaded:int (default = 0) — The number of files that have downloaded successfully.
 
rslsFailed:int (default = 0) — The number of files that have failed to download.
 
rslsTotal:int (default = 0) — The total number of files that have downloaded, successfully or not.
 
bytesLoaded:int (default = 0) — The total number of downloaded bytes in files that have successfully downloaded.
 
bytesTotal:int (default = 0) — The total number of downloaded bytes in files that have downloaded, successful or not.
Constant Detail

RSL_LOAD_COMPLETE

Constant
public static const RSL_LOAD_COMPLETE:String = "rslLoadComplete"

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

Event dispatched by RSLPreloader when all RSLs have successfully downloading. The bytesLoaded and bytesTotal properties are always 0 for this event type. When preloading with a custom event loop, user content MUST listen for this event to determine when to exit the loading animation loop.

This event has the following properties:

PropertyValue
bubblestrue
cancelablefalse; 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.
rslsLoadedThe number of files that have downloaded successfully.
rslsFailedthe number of files that have failed to download.
rslsTotalthe total number of files that have downloaded, successfully or not.
bytesLoadedThe total number of downloaded bytes in files that have successfully downloaded.
bytesTotalthe total number of downloaded bytes in files that have downloaded, successful or not.
         import fl.events.RSLEvent;
         myPreloader.addEventListener(RSLEvent.RSL_LOAD_COMPLETE, loadComplete);
         function loadComplete(e:RSLEvent) {
         gotoAndPlay('startOfContent');
         }
         

Related API Elements

RSL_PROGRESS

Constant 
public static const RSL_PROGRESS:String = "rslProgress"

Language Version: ActionScript 3.0
Product Version: Flash CS5
Runtime Versions: Flash Player 10.1, AIR 2

Event dispatched by RSLPreloader to indicate progress in downloading RSL files. This is the only event type for which the bytesLoaded and bytesTotal properties are non-zero.

This event has the following properties:

PropertyValue
bubblestrue
cancelablefalse; 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.
rslsLoadedThe number of files that have downloaded successfully.
rslsFailedthe number of files that have failed to download.
rslsTotalthe total number of files that have downloaded, successfully or not.
bytesLoadedThe total number of downloaded bytes in files that have successfully downloaded.
bytesTotalthe total number of downloaded bytes in files that have downloaded, successful or not.
         import fl.events.RSLEvent;
         myPreloader.addEventListener(RSLEvent.RSL_PROGRESS, progressHandler);
         function progressHandler(e:RSLEvent) {
         trace('rslsLoaded = ' + e.rslsLoaded);
         trace('rslsFailed = ' + e.rslsFailed);
         trace('rslsTotal = ' + e.rslsTotal);
         trace('bytesLoaded = ' + e.bytesLoaded);
         trace('bytesTotal = ' + e.bytesTotal);
         }
         

Related API Elements