Opening A Web Page; Initiating A Phone Call - MACROMEDIA FLASH 8-LEARNING FLASH LITE 1.X ACTIONSCRIPT Manual

Learning flash lite 1.x actionscript
Table of Contents

Advertisement

Typically, you use capability variables to determine if a device supports a specific feature
before attempting to use that feature. For example, suppose that you wanted to develop an
application that downloads data from a web server using the
Before attempting to load the data, you can first check the value of the
variable to determine if the device supports that feature, as follows:
if(_capLoadData == 1) {
loadVariables("http://www.macromedia.com/data.txt");
} else {
status_message = "Sorry, unable to load external data."
}
Flash Lite defines capability variables on the root timeline of the main SWF file. So to access
these variables from another timeline—for example, from within a movie clip's timeline—you
need to qualify the path to the variable. For instance, the following example uses a slash (
provide the fully qualified path to the
canSendSMS = /:_capSMS

Opening a web page

You use the
getURL()
same way you open a web page from a desktop Flash application. For example, the following
opens the Macromedia web page:
getURL("http:www.macromedia.com");
Flash Lite processes only one
handsets restrict the
getURL()
is processed only if it is triggered within a keypress event handler. Even under such
circumstances, only one
following code, attached to a button instance on the Stage, opens a web page when the user
presses the Select button on the device:
on (keyPress "<Enter>"){
getURL("http://www.macromedia.com");
}

Initiating a phone call

To initiate a phone call from a Flash Lite application, you use the
Typically, you use this function to open a web page, but in this case you specify
protocol (in place of
When you call this function, Flash Lite displays a confirmation dialog box asking the user for
permission to make the call to the specified number.
20
Common Scripting Tasks
_capSMS
command to open a web page in the device's web browser. This is the
action per frame or per event handler. Certain
getURL()
action to keypress events only, in which case the
action is processed per keypress event handler. The
getURL()
, and then provide the phone number you wish the phone to dial.
http)
loadVariables()
variable.
getURL()
function.
_capLoadData
) to
/
call
getURL()
function.
as the
tel:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING FLASH LITE 1.X ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents