Package | fl.rsl |
Class | public class RSLInfo |
Inheritance | RSLInfo EventDispatcher Object |
Subclasses | SWZInfo |
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
addEntry()
.
The RSLInfo class can dispatch any of these events: Event.COMPLETE
, IOErrorEvent.IO_ERROR
,
SecurityErrorEvent.SECURITY_ERROR
and ProgressEvent.PROGRESS
.
Because of the use of failovers, even if SecurityErrorEvents or
IOErrorEvents are dispatched, the RSL download has not failed
until the failed
property returns true
.
Related API Elements
Property | Defined By | ||
---|---|---|---|
bytesLoaded : int [read-only]
Indicates the number of bytes that have been loaded thus far for all files being loaded. | RSLInfo | ||
bytesTotal : int [read-only]
Indicates the total number of bytes that have been loaded thus far for all files being loaded. | RSLInfo | ||
complete : Boolean [read-only]
Returns a value of true if the download has completed
successfully and false if
the download is not yet complete or has failed. | RSLInfo | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
currentAttemptIndex : int [read-only]
Returns the index of the URL currently attempting to download. | RSLInfo | ||
failed : Boolean [read-only]
Returns a value of true if the download has failed and false
if the download is
not yet complete or has completed successfully. | RSLInfo | ||
loader : Loader [read-only]
Returns the loader used to download the RSL. | RSLInfo | ||
policyFileURLs : Array [read-only]
Returns an array of policy file URLs that have been added via addEntry(). | RSLInfo | ||
rslURLs : Array [read-only]
Returns an array of RSL URLs added via addEntry(). | RSLInfo |
Method | Defined By | ||
---|---|---|---|
RSLInfo()
Constructor. | RSLInfo | ||
Adds a series of URLs (RSL files and policy files). | RSLInfo | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Dispatches an event into the event flow. | EventDispatcher | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Starts the RSL download. | RSLInfo | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Returns the primitive value of the specified object. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
bytesLoaded | property |
bytesLoaded:int
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Indicates the number of bytes that have been loaded thus far for all files being loaded. Because some loads may fail and go to failover URLs, the bytesLoaded value can increase or decrease over time. Progress bars must compensate for this to avoid moving backward.
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 |
Indicates the total number of bytes that have been loaded thus far for all files being loaded. Because some loads may fail and go to failover URLs, the bytesTotal value can increase or decrease over time. Progress bars must compensate for this to avoid moving backward.
Implementation
public function get bytesTotal():int
complete | property |
complete:Boolean
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Returns a value of true
if the download has completed
successfully and false
if
the download is not yet complete or has failed.
Implementation
public function get complete():Boolean
currentAttemptIndex | property |
currentAttemptIndex:int
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Returns the index of the URL currently attempting to download. When failure events are received, this index points to the URL that failed. The index belongs to the rslURLs and policyFileURLs arrays. Before downloading has begun, the index value is -1, After downloading has completed, it is equal to the length of the arrays, so range checking is recommended before using this value to access a URL array member.
import fl.rsl.RSLInfo; var info:RSLInfo = new RSLInfo(); info.addEventListener(IOErrorEvent.IO_ERROR, handleErr); function handleErr(e:Event) { trace('error: ' + e); trace('on download of url: ' + info.rslURLs[info.currentAttemptIndex]); }
Implementation
public function get currentAttemptIndex():int
failed | property |
failed:Boolean
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Returns a value of true
if the download has failed and false
if the download is
not yet complete or has completed successfully. The failed
property is
not set to true
if a single url has failed and there
are additional failover URLs to attempt.
Implementation
public function get failed():Boolean
loader | property |
policyFileURLs | property |
policyFileURLs:Array
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Returns an array of policy file URLs that have been added via addEntry()
.
Treat this array as read-only. Add entries by
calling addEntry()
. Editing this array directly will cause
unpredictable results.
import fl.rsl.RSLInfo; var info:RSLInfo = new RSLInfo(); for (var i:int = 0; i < info.policyFileURLs.length; i++) { trace('url: ' + info.policyFileURLs[i]); }
Implementation
public function get policyFileURLs():Array
Related API Elements
rslURLs | property |
rslURLs:Array
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Returns an array of RSL URLs added via addEntry()
. Treat this array
as read-only. Add entries by calling
addEntry()
. Editing this array directly will cause
unpredictable results.
import fl.rsl.RSLInfo; var info:RSLInfo = new RSLInfo(); for (var i:int = 0; i < info.rslURLs.length; i++) { trace('url: ' + info.rslURLs[i]); }
Implementation
public function get rslURLs():Array
Related API Elements
RSLInfo | () | Constructor |
public function RSLInfo()
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Constructor.
addEntry | () | method |
public function addEntry(url:String, policyFileURL:String = null):void
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Adds a series of URLs (RSL files and policy files). The order in which the URLs are added depends on their download priority. The first URL is tried first, the second will not be tried until the first has failed, and so on. Policy files are added only when the matching RSL file URL is downloaded.
import fl.rsl.RSLInfo; var info:RSLInfo = new RSLInfo(); info.addEntry('rsl.swf'); myPreloader.addRSLInfo(info); myPreloader.start();
Parameters
url:String | |
policyFileURL:String (default = null )
|
load | () | method |
public function load():void
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS5 |
Runtime Versions: | Flash Player 10.1, AIR 2 |
Starts the RSL download. The first entry added is tried first. Subsequent entries are tried as backups as failures occur.
Thu Dec 6 2018, 01:12 PM -08:00