MACROMEDIA FLASH 8-LEARNING FLASH LITE 1.X ACTIONSCRIPT Manual - page 22
22
Common Scripting Tasks
Initiating an e-mail message
You can use Flash Lite to initiate an e-mail message. To initiate an e-mail message, you use the
getURL()
command and pass it the
mailto:
protocol, followed by the recipient’s e-mail
address. You can optionally specify the message subject and body in the URL’s query string,
as follows:
getURL("mailto:mobile-developer@macromedia.com?subject=Flash Lite");
To specify just the message body in the query string, use the following code:
getURL("mailto:mobile-developer@macromedia.com?body=More+info+please");
Loading external SWF files
The
loadMovie()
function lets you load SWF files from a network or local file. This feature
is only available in Flash Lite 1.1 and later. The following caveats apply when you load
external SWF files:
■
Flash Lite can load other Flash Lite 1.0 or Flash Lite 1.1 SWF files, or Flash 4-formatted
SWF files or earlier. If you attempt to load a SWF file in another format (for example, a
Flash Player 6 SWF file), Flash Lite will generate a runtime error.
■
Flash Lite cannot directly load external image files, such as JPEG or GIF images. To load
these types of media, you need to convert the image data to the SWF file format. You can
do this “manually” with the Flash authoring tool by importing the image file into a new
document, and then exporting the file to a Flash Lite or Flash 4 SWF file. There are also
third-party utilities that can perform this type of conversion for you automatically.
For more information about loading SWF files, see
loadMovie()
in Flash Lite 1.x ActionScript
Language Reference.
Loading external data
To load external data into a Flash Lite application, you use the
loadVariables()
function.
You can load data over the network (from an HTTP address) or from the local file system.
This feature is available only in Flash Lite 1.1 and later.
This section demonstrates how to use the
loadVariables()
function to load data from an
external file and display that data in dynamic text fields. First you’ll create the data file, a text
file that contains five name-value pairs separated by ampersand (&) symbols. Then you’ll
create the Flash Lite application that loads and displays the data contained in the text file.