getURL()
17
Flash Lite 1.0 recognizes only the HTTP, HTTPS, mailto, and tel protocols. Flash Lite 1.1
recognizes these protocols, and in addition, the file, SMS (short message service), and MMS
(multimedia message service) protocols.
Flash Lite passes the call to the operating system, and the operating system handles the call
with the registered default application for the specified protocol.
Only one
getURL()
function is processed per frame or per event handler.
Certain handsets restrict the
getURL()
function to key events only, in which case the
getURL()
call is processed only if it is triggered in a key event handler. Even under such
circumstances, only one
getURL()
function is processed per event handler.
Example
In the following ActionScript, the Flash Lite player opens mobile.macromedia.com in the
default browser:
myURL = "http://mobile.macromedia.com";
on(keyPress "1") {
getURL(myURL);
}
You can also use
GET
or
POST
for sending variables from the current timeline. The following
example uses the
GET
method to append variables to a URL:
firstName = "Gus";
lastName = "Richardson";
age = 92;
getURL("http://www.macromedia.com", "_blank", "GET");
The following ActionScript uses
POST
to send variables in an HTTP header:
firstName = "Gus";
lastName = "Richardson";
age = 92;
getURL("http://www.macromedia.com", "POST");
You can assign a button function to open an e-mail composition window with the
address
,
subject
, and
body
text fields already populated. Use one of the following methods to assign a
button function: Method 1 for either Shift-JIS or English character encoding; Method 2 only
for English character encoding.
Method 1: Set variables for each of the desired parameters, as in this example:
on (release, keyPress "#"){
subject = "email subject";
body = "email body";
getURL("mailto:[email protected]", "", "GET");
}
Summary of Contents for FLASH 8-FLASH
Page 1: ...Flash Lite 1 x ActionScript Language Reference...
Page 6: ...6 Contents...
Page 46: ...46 Flash Lite Global Functions...
Page 62: ...62 Flash Lite Properties...
Page 76: ...76 Flash Lite Statements...
Page 110: ...110 Flash Lite Operators...
Page 162: ...162 Index...