mx.controls
Class Loader


Direct Known Subclasses
           mx.controls.Image

class Loader
extends mx.core.View

The Loader control displays the contents of a specified SWF or JPG file. It has properties that let you scale its contents and accept setSize calls. 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.

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:Loader
autoLoad="true|false"
brokenImage="No default."
contentPath="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) : Void
Begins loading an image or SWF file.

Methods inherited from class mx.core.View
init  draw  createChild  getChildAt  getChildIndex  setChildIndex  destroyAllChildren  destroyChild  destroyChildAt  getViewMetrics 

Methods inherited from class mx.core.UIComponent
getFocus  setFocus  getFocusManager 

Methods inherited from class mx.core.UIObject
createAccessibilityImplementation  measure  doLater  cancelAllDoLaters  invalidate  invalidateStyle  invalidateProperties  invalidateSize  redraw  move  setSize  setSizeNoLayout  drawRect  fillRect  destroyLabel  createClassObject  createEmptyObject  destroyObject  getStyle  setMask  swapDepths 


Properties
staticversion:String  
ComponentVersion is for internal use only.
      autoLoad:Boolean   [Read-Write]
If true, the content loads automatically.
      brokenImage:String   [Read-Write]
Image 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:UIComponent   [Read-Only]
Content of the Loader.
      contentPath:String   [Read-Write]
Absolute or relative URL of the image or SWF file to load.
      percentLoaded:Number   [Read-Only]
Percent of the image or SWF file already loaded.
      scaleContent:Boolean   [Read-Write]
If true, the content scales to fit the Loader.

Properties inherited from class mx.core.View
version  className  numChildren 

Properties inherited from class mx.core.UIComponent
version  enabled  tabIndex 

Properties inherited from class mx.core.UIObject
version  nestLevel  dispatchEvent  addEventListener  handleEvent  removeEventListener  kStretch  styleName  className  setStyle  parentApplication  isDocument  parentDocument  documentDescriptor  descriptor  instanceIndices  repeaterIndices  getRepeaterItem  id  width  height  x  y  minHeight  minWidth  preferredHeight  preferredWidth  maxHeight  maxWidth  widthFlex  heightFlex  visible  scaleX  scaleY  alpha  depth  mouseX  mouseY  toolTip  baselinePosition 


Effects

Effects inherited from class mx.core.UIComponent
showEffect  hideEffect  focusInEffect  focusOutEffect 

Effects inherited from class mx.core.UIObject
creationCompleteEffect  moveEffect  resizeEffect  mouseDownEffect  mouseOverEffect  mouseOutEffect  mouseUpEffect 


Events
completeBroadcast when content loading is complete. This event is broadcast regardless of whether the load was triggered by an autoload or an explicit load() call. Target contains a reference to the component that triggered the event. Type contains the name of the event.
progressBroadcast 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. Target contains a reference to the component that triggered the event. Type contains the name of the event.

Events inherited from class: mx.core.View
childCreated  childIndexChanged  childDestroyed 

Events inherited from class: mx.core.UIComponent
focusIn  focusOut  keyDown  keyUp  show  hide  valid  invalid  valueCommitted 

Events inherited from class: mx.core.UIObject
initialize  creationComplete  resize  move  draw  load  unload  mouseDown  mouseUp  mouseMove  mouseOver  mouseOut  mouseDownSomewhere  mouseUpSomewhere  mouseMoveSomewhere  mouseChangeSomewhere  effectStart  effectEnd  dragBegin  dragComplete  dragEnter  dragOver  dragExit  dragDrop 


Styles
horizontalAlign CSS Inheritance: no
Horizontal 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: no
Vertical 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.UIComponent
backgroundColor  backgroundDisabledColor  backgroundImage  backgroundAlpha  backgroundSize  barColor  borderCapColor  borderColor  buttonColor  borderStyle  disabledColor  errorColor  highlightColor  lineHeight  modalTransparency  scrollTrackColor  shadowColor  shadowCapColor  symbolColor  symbolBackgroundColor  symbolBackgroundDisabledColor  symbolBackgroundPressedColor  symbolDisabledColor  themeColor 

Styles inherited from class mx.core.UIObject
color  fontFamily  fontSize  fontStyle  fontWeight  textAlign  textDecoration  textIndent  marginLeft  marginRight  horizontalGap  verticalGap 


Method Detail

load

load(url:String) : Void

Begins loading an image or SWF file.

Parameters
     url - Absolute or relative URL of image or SWF file to load.


Property Detail

autoLoad

autoLoad:Boolean   [Read-Write]

If true, the content loads automatically. If false, you must call the load method. The default value is true.


brokenImage

brokenImage:String   [Read-Write]

Image to display if load fails.


bytesLoaded

bytesLoaded:Number   [Read-Only]

Number of bytes of the image or SWF file already loaded.


bytesTotal

bytesTotal:Number   [Read-Only]

Total size of the image or SWF file.


content

content:UIComponent   [Read-Only]

Content of the Loader.


contentPath

contentPath:String   [Read-Write]

Absolute or relative URL of the image or SWF file to load.


percentLoaded

percentLoaded:Number   [Read-Only]

Percent of the image or SWF file already loaded.


scaleContent

scaleContent:Boolean   [Read-Write]

If true, the content scales to fit the Loader. If false, the Loader scales to fit the content. The default value is true.


version

static version:String  

ComponentVersion is for internal use only.