contentPath
an absolute or relative URL indicating the file to load into the loader. A relative
path must be relative to the SWF file loading the content. The URL must be in the same
subdomain as the URL where the Flash content currently resides. For use in Flash Player or in
test-movie mode, all SWF files must be stored in the same folder, and the filenames cannot
include folder or disk drive specifications. The default value is
scaleContent
indicates whether the content scales to fit the loader (
fit the content (
false
You can write ActionScript to set additional options for Loader instances using its methods,
properties, and events. For more information, see
Creating an application with the Loader component
The following procedure explains how to add a Loader component to an application while
authoring. In this example, the loader loads a logo JPEG from an imaginary URL.
To create an application with the Loader component:
Drag a Loader component from the Components panel to the Stage.
1.
Select the loader on the Stage and use the Free Transform tool to size it to the dimensions of
2.
the corporate logo.
In the Property inspector, enter the instance name logo.
3.
Select the loader on the Stage and in the Component inspector, and enter http://corp.com/
4.
websites/logo/corplogo.jpg for the contentPath parameter.
Customizing the Loader component
You can transform a Loader component horizontally and vertically while authoring and at
runtime. While authoring, select the component on the Stage and use the Free Transform tool or
any of the Modify > Transform commands. At runtime, use the
UIObject.setSize()
The sizing behavior of the Loader component is controlled by the
is
scaleContent
when
UIObject.setSize()
is fixed to the size of the content and
Using styles with the Loader component
The Loader component uses the following styles.
Style
border styles
). The default value is
).
, the content is scaled to fit within the bounds of the loader (and is rescaled
true
is called). When
UIObject.setSize()
Theme Description
Both
The Loader component uses a RectBorder instance as its
border and responds to the styles defined on that class. See
"RectBorder class" on page
The default border style is
undefined
.
true
"Loader class" on page
setSize()
scaleContent
is
scaleContent
false
has no effect.
647.
"none"
until the load starts.
), or the loader scales to
true
486.
method (see
property. When
, the size of the component
.
Loader component
485
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers