MACROMEDIA FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE Reference page 173

Server-side actionscript language reference
Table of Contents

Advertisement

XML.attributes
Availability
Flash Media Server 2.
Usage
my_xml.attributes
Description
Property; an object that contains all the attributes of the specified XML object. Associative
arrays use keys as indexes, not ordinal integer indexes used by regular arrays. In the
associative array, the key index is a string representing the name of the
XML.attributes
attribute. The value associated with that key index is the string value associated with that
attribute. For example, if you have an attribute named
attribute's value by using the color as the key index, as shown in the following code:
var myColor = doc.firstChild.attributes.color
Example
The following example shows the XML attribute names:
// Create a tag called 'mytag' with
// an attribute called 'name' with value 'Val'.
var doc = new XML("<mytag name=\"Val\"> item </mytag>");
// Assign the value of the 'name' attribute to variable y.
var y = doc.firstChild.attributes.name;
trace (y);
// output: Val
// Create a new attribute named 'order' with value 'first'.
doc.firstChild.attributes.order = "first";
// Assign the value of the 'order' attribute to variable z.
var z = doc.firstChild.attributes.order
trace(z);
// output: first
In Flash Media Server, the output of
file and Application inspector.
, you would retrieve that
color
statements appears in the application log
trace()
XML class
173

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash media server 2

Table of Contents