![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
You can use a loader whenever you need to grab content from a remote location and pull it into a Flash application. For example, you could use a loader to add a company logo (JPEG file) to a form. You could also use a loader to leverage Flash work that has already been completed. For example, if you had already built a Flash application and wanted to expand it, you could use the loader to pull the old application into a new application, perhaps as a section of a tab interface. In another example, you could use the loader component in an application that displays photos. Use Loader.load()
, Loader.percentLoaded
, and Loader.complete
to control the timing of the image loads and display progress bars to the user during loading.
The following are authoring parameters that you can set for each Loader component instance in the Property inspector or in the Component Inspector panel:
autoload indicates whether the content should load automatically (true), or wait to load until the Loader.load()
method is called (false). The default value is true.
content an absolute or relative URL indicating the file to load into the loader. A relative path must be relative to the SWF loading the content. The URL must be in the same subdomain as the URL where the Flash content currently resides. For use in the stand-alone Flash Player or for testing 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 undefined until the load had started.
scaleContent indicates whether the content scales to fit the Loader (true), or the Loader scales to fit the content (false). The default value is true.
You can write ActionScript to set additional options for Loader instances using its methods, properties, and events. For more information, see Loader class.
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.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |