| Methods | Properties | Effects | Events | Styles | Examples | Frames | No Frames |
Direct Known Subclasses![]()
The Loader control displays the contents of a specified SWF or JPG file. It has properties that let you scale its contents and set its size. It can also resize itself to fit the size of its contents. By default, content is scaled to fit the size of the Loader control. It can also load content on demand programmatically, and monitor the progress of a load. Although the Loader tag allows loading of images, the Image tag has been tuned for this capability.
A Loader component cannot receive focus. However, content loaded into the Loader component can accept focus and have its own focus interactions. Although the Loader is essentially a control, it extends the View container.
MXML Syntax
The <mx:Loader> tag inherits all the properties of its parent classes, and the following properties:<mx:LoaderClick here to view the Examples
autoLoad="true|false"
brokenImage="No default."
source="No default."
horizontalAlign="left|center|right"
scaleContent="true|false"
verticalAlign="top|middle|bottom"
complete="Event handler; no default."
progress="Event handler; no default."
/>
| Methods | |
| load(
url:
String)
:
VoidBegins loading an image or SWF file. |
| Methods inherited from class mx.core.UIComponent |
drawFocus
getFocus
getFocusManager
setEnabled
setFocus
|
| Properties | |
| autoLoad:
BooleanIf true, the content loads automatically. |
| brokenImage:
StringImage to display if load fails. |
| bytesLoaded:
Number
[Read-Only]
Number of bytes of the image or SWF file already loaded. |
| bytesTotal:
Number
[Read-Only]
Total size of the image or SWF file. |
| content:
mx.core.UIComponent
[Read-Only]
Content of the Loader. |
| percentLoaded:
Number
[Read-Only]
Percent of the image or SWF file already loaded. |
| scaleContent:
BooleanIf true, the content scales to fit the Loader. |
| source:
String Specification of content location. |
static | version:
StringVersion string for this class. |
| Properties inherited from class mx.core.View |
baselinePosition
className
numChildren
version
|
| Properties inherited from class mx.core.UIComponent |
enabled
errorString
tabEnabled
tabIndex
version
|
| Effects |
| Effects inherited from class mx.core.UIComponent |
focusInEffect
focusOutEffect
|
| Effects inherited from class mx.core.UIObject |
creationCompleteEffect
hideEffect
mouseDownEffect
mouseOutEffect
mouseOverEffect
mouseUpEffect
moveEffect
resizeEffect
showEffect
|
| Events | |
complete | Broadcast when content loading is complete. This event is broadcast regardless of whether the load was triggered by an autoload or an explicit load() call. The event object's target property contains a reference to the component that triggered the event. The event object's type property contains the name of the event, complete. |
progress | Broadcast when content is loading. This event is broadcast regardless of whether the load was triggered by an autoload or an explicit load() call. 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. The event object's target property contains a reference to the component that triggered the event. The event object's type property contains the name of the event, progress. |
| Events inherited from class: mx.core.View |
childCreated childDestroyed childIndexChanged |
| Events inherited from class: mx.core.UIComponent |
focusIn focusOut invalid keyDown keyUp valid valueCommitted |
| Styles | |
horizontalAlign |
CSS Inheritance:
noHorizontal alignment of the image when it does not have a one-to-one aspect ratio. The default value is left. Possible values are left, center, and right. |
verticalAlign |
CSS Inheritance:
noVertical alignment of the image when it does not have a one-to-one aspect ratio. The default value is top. Possible values are top, middle, and bottom. |
| Styles inherited from class mx.core.UIObject |
color
fontFamily
fontSize
fontStyle
fontWeight
horizontalGap
leading
marginLeft
marginRight
textAlign
textDecoration
textIndent
verticalGap
|
| Method Detail |
load(
url:
String)
:
Void
Parameters
url:
String - Absolute or relative URL of JPG or SWF file to load.
| Property Detail |
autoLoad:
Boolean
brokenImage:
String
bytesLoaded:
Number
[Read-Only]
bytesTotal:
Number
[Read-Only]
content:
mx.core.UIComponent
[Read-Only]
percentLoaded:
Number
[Read-Only]
scaleContent:
Boolean
source:
String
source property takes the following form:source="relativeOrAbsoluteURL"source property only supports the loading of JPEG images and SWF files.
static
version:
String
| Examples |
| SimpleLoader.mxml |
|
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/15/asdocs_en/mx/controls/Loader.html
Comments
Greg Fuller said on Feb 15, 2005 at 12:37 PM :