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

ContentRequest  - AS3 Flex

Packagespark.core
Classpublic class ContentRequest
InheritanceContentRequest Inheritance EventDispatcher Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 1.5

Represents an IContentLoader content request instance returned from IContentLoader's load() method.



Public Properties
 PropertyDefined By
  complete : Boolean
[read-only] Contains true if content is considered fully loaded and accessible.
ContentRequest
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  content : Object
A reference to contained content.
ContentRequest
Public Methods
 MethodDefined By
  
ContentRequest(contentLoader:IContentLoader, content:*, shared:Boolean = false, complete:Boolean = false)
Constructor.
ContentRequest
 Inherited
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
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
  Dispatched when content loading is complete.ContentRequest
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
  Dispatched when a network request is made over HTTP and Flash Player or AIR can detect the HTTP status code.ContentRequest
  Dispatched when an input/output error occurs.ContentRequest
  Dispatched when content is loading.ContentRequest
  Dispatched when a security error occurs.ContentRequest
Property Detail

complete

property
complete:Boolean  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Contains true if content is considered fully loaded and accessible.

The default value is false.



Implementation
    public function get complete():Boolean

content

property 
content:Object

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 1.5

A reference to contained content. This can be (among many things), a LoaderInfo instance, BitmapData, or any other generic content. When the complete event has fired and/or complete() returns true, the content is considered valid.



Implementation
    public function get content():Object
    public function set content(value:Object):void
Constructor Detail

ContentRequest

()Constructor
public function ContentRequest(contentLoader:IContentLoader, content:*, shared:Boolean = false, complete:Boolean = false)

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 1.5

Constructor.

Parameters
contentLoader:IContentLoader — The IContentLoader object.
 
content:* — A reference to contained content.
 
shared:Boolean (default = false)true indicates that this request is currently being shared by other previous requests
 
complete:Boolean (default = false)true indicates that someone has called load on a cache, and the cache has returned immediately with a fully loaded result
Event Detail

complete

Event
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.COMPLETE

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.0

Dispatched when content loading is complete.

The Event.COMPLETE constant defines the value of the type property of a complete event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; 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.

httpStatus

Event  
Event Object Type: flash.events.HTTPStatusEvent
property HTTPStatusEvent.type = flash.events.HTTPStatusEvent.HTTP_STATUS

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.0

Dispatched when a network request is made over HTTP and Flash Player or AIR can detect the HTTP status code.

The HTTPStatusEvent.HTTP_STATUS constant defines the value of the type property of a httpStatus event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; 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.

ioError

Event  
Event Object Type: flash.events.IOErrorEvent
property IOErrorEvent.type = flash.events.IOErrorEvent.IO_ERROR

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.0

Dispatched when an input/output error occurs.

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

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; 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.

Related API Elements

progress

Event  
Event Object Type: flash.events.ProgressEvent
property ProgressEvent.type = flash.events.ProgressEvent.PROGRESS

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.0

Dispatched when content is loading.

Note: The progress event is not guaranteed to be dispatched. The complete event may be received, without any progress events being dispatched. This can happen when the loaded content is a local file.

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

This event has the following properties:

PropertyValue
bubblesfalse
bytesLoadedThe 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.

securityError

Event  
Event Object Type: flash.events.SecurityErrorEvent
property SecurityErrorEvent.type = flash.events.SecurityErrorEvent.SECURITY_ERROR

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.0

Dispatched when a security error occurs.

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

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; 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.

Related API Elements