spark.core

# ContentRequest - AS3 Flex

Package | spark.core
Class | public class ContentRequest
Inheritance | ContentRequest EventDispatcher 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
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | complete : Boolean [read-only] Contains true if content is considered fully loaded and accessible. | ContentRequest
|  | constructor : 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
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | ContentRequest(contentLoader:IContentLoader, content:*, shared:Boolean = false, complete:Boolean = false) Constructor. | ContentRequest
|  | 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
|  | dispatchEvent(event:Event):Boolean Dispatches an event into the event flow. | EventDispatcher
|  | hasEventListener(type:String):Boolean Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | EventDispatcher
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void Removes a listener from the EventDispatcher object. | EventDispatcher
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object
|  | willTrigger(type:String):Boolean Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | EventDispatcher

Events
Click for more information on events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | activate | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher
|  | complete | Dispatched when content loading is complete. | ContentRequest
|  | deactivate | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher
|  | httpStatus | Dispatched when a network request is made over HTTP and Flash Player or AIR can detect the HTTP status code. | ContentRequest
|  | ioError | Dispatched when an input/output error occurs. | ContentRequest
|  | progress | Dispatched when content is loading. | ContentRequest
|  | securityError | 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`status` | The HTTP status code returned by the server.
`target` | The 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`errorID` | A reference number associated with the specific error (AIR only).
`target` | The network object experiencing the input/output error.
`text` | Text to be displayed as an error message.

Related API Elements

flash.events.IOErrorEvent

### 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:

Property | Value
--- | ---
`bubbles` | `false`
`bytesLoaded` | The number of items or bytes loaded at the time the listener processes the event.
`bytesTotal` | The total number of items or bytes that ultimately will be loaded if the loading process succeeds.
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The network object reporting the security error.
`text` | Text to be displayed as an error message.

Related API Elements

flash.events.SecurityErrorEvent

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00