Using The Preloader; Accessing Request Data - Adobe FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual

Migrating applications to flex 2
Table of Contents

Advertisement

Using the Preloader

The Application container supports an application preloader that uses a download progress
bar to show the download progress of an application SWF file. By default, the application
preloader is enabled. The preloader keeps track of how many bytes are downloaded and
continually updates the progress bar.
By default, the application preloader uses the DownloadProgressBar class in the mx.preloaders
package to display the download progress bar. To create a custom download progress bar, you
can either create a subclass of the DownloadProgressBar class, or create a subclass of the
flash.display.Sprite class that implements the mx.preloaders.IPreloaderDsiplay interface.
The operation of the download progress bar is defined by a set of events. These events are
dispatched by the Preloader class. A custom download progress bar must handle these events.
For more information, see Chapter 14, "Using the Application Container," in the Flex 2
Developer's Guide.

Accessing request data

You can pass request data to any Flex application by using
and
<object>
<embed>
specify the request data as query string parameters. The server converts these to
variables when it generates the wrapper. The
name and value pairs, as the following example shows:
flashVars='firstname=Nick&middlename=D&lastname=Danger'
The way in which you access these variables is changed. In Flex 1.x, you could access the
values of
flashVars
the previous example, you could access the values of the
variables in your Flex application by just declaring them, as the following example
lastname
shows:
<mx:Script>
var firstname; // Initialized to "Nick".
var middlename; // Initialized to "D".
var lastname; // Initialized to "Danger".
</mx:Script>
tags in the wrapper. If you are using Flex Data Services, you can
variables by declaring a public global variable of the same name. Using
flashVars
variables are a series of URL-encoded
flashVars
firstname
variables in the
flashVars
,
, and
middlename
Accessing request data
183

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents