MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 68

Actionscript language reference
Table of Contents

Advertisement

The functions and MovieClip methods that use the HTTP or HTTPS protocol to send
information in URL-encoded format are
loadVariablesNum()
The LoadVars methods that use the HTTP or HTTPS protocol to send and load information
in URL-encoded format are
The methods that use HTTP or HTTPS protocol to send and load information as XML are
,
XML.send()
The methods that create and use a TCP/IP socket connection to send and load information as
XML are
XMLSocket.connect()
For more information, see the following topics:
"Checking for loaded data" on page 68
"Using HTTP to connect to server-side scripts" on page 69
"Using the LoadVars class" on page 69
"About XML" on page 70
"Using the XML class" on page 71
"Using the XMLSocket class" on page 71
Checking for loaded data
Each function or method that loads data into a SWF file (except
asynchronous: The results of the action are returned at an indeterminate time.
Before you can use loaded data in a SWF file, you must check to see if it has been loaded. For
example, you can't load variables and manipulate their values in the same script because the data
to manipulate doesn't exist in the file until it is loaded. In the following script, you cannot use the
variable
lastSiteVisited
file
myData.txt
lastSiteVisited=www.macromedia.com
But if you used the following code, you could not trace the data that is loading:
loadVariables("myData.txt", 0);
trace(lastSiteVisited);
If you use the
XML.load()
should define a handler that will process the data when it arrives. This handler is a property of an
XML or XMLSocket object to which you assign a function you defined. The handlers are called
automatically when the information is received. For the XML object, use
. For the XMLSocket object, use
XML.onData()
For more information, see
on page
71. For information on how to load data in Flex applications, see also Developing Flex
Applications. For more information on using LoadVars to send and load data that can be processed
after the data is received, see
68
Chapter 3: Working with External Data
,
loadMovie()
load()
, and
XML.load()
XML.sendAndLoad()
and
until you're sure that the variable has loaded from the
. In the file myData.txt, you would have text similar to the following example:
,
XML.sendAndLoad()
"Using the XML class" on page 71
"Using the LoadVars class" on page
,
getURL()
loadVariables()
, and
loadMovieNum()
,
, and
send()
sendAndLoad()
.
XMLSocket.send()
, and
XMLSocket.connect()
XMLSocket.onConnect()
,
.
.
.
XMLSocket.send()
methods, you
XML.onLoad()
.
and
"Using the XMLSocket class"
69.
) is
or

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents