This ActionScript creates a new LoadVars object instance, copies the values from the text fields
into the instance, and then sends the data to the server. The CFM file sends the e-mail and
returns a variable (
text field.
debug_txt
Note: Remember to change the URL www.yoursite.com to your own domain.
Save the document as sendEmail.fla, and then publish it by selecting File > Publish.
9.
Upload sendEmail.swf to the same directory that contains email.cfm (the ColdFusion file you
10.
saved and uploaded in step 2).
View and test the SWF file in a browser.
11.
For more information, see the "LoadVars class" entry in Flash ActionScript Language Reference.
About XML
Extensible Markup Language (XML) is becoming the standard for exchanging structured data in
Internet applications. You can integrate data in Flash with servers that use XML technology to
build sophisticated applications, such as chat or brokerage systems.
In XML, as with HTML, you use tags to specify, or mark up, a body of text. In HTML, you use
predefined tags to indicate how text should appear in a web browser (for example, the
indicates that text should be bold). In XML, you define tags that identify the type of a piece of
data (for example,
information from the way it appears, so the same XML document can be used and reused in
different environments.
Every XML tag is called a node, or an element. Each node has a type (1, which indicates an XML
element, or 3, which indicates a text node), and elements might also have attributes. A node
nested in a node is called a child node. This hierarchical tree structure of nodes is called the XML
DOM—much like the JavaScript DOM, which is the structure of elements in a web browser.
In the following example,
child node
<holding>
<portfolio>
<holding symbol="rich"
qty="75"
price="245.50"
value="18412.50" />
</portfolio>
For more information on XML, see www.w3.org/XML.
Using the XML class
The methods of the ActionScript XML class (for example,
insertBefore()
interpret downloaded XML data.
280
Chapter 11: Working with External Data
or
) to the SWF file called
true
false
<password>VerySecret</password>
<portfolio>
, which has the attributes
) let you structure XML data in Flash to send to a server and manipulate and
result,
). XML separates the structure of the
is the parent node; it has no attributes and contains the
,
,
symbol
qty
price
appendChild()
which appears in the
<b>
, and
:
value
,
removeNode()
tag
, and
Need help?
Do you have a question about the FLASH MX 2004-USING ACTIONSCRIPT IN FLASH and is the answer not in the manual?
Questions and answers