xml| Monitoring
Keywords: flash, XML, Xmlsocket, TextField, Web mode, timely monitoring
Second, Technical introduction
1. XML objects
By using the methods and properties of the object instance, you can load, parse, send, construct, and maintain the XML document tree.
The exciting thing is that in the latest flash version of Flash MX, the XML object has become a local object, the direct support built into Flashplayer 6 (Flash Player 5 is only 300 KB, and Flash Player 6 has a KB, The built-in many objects are quite a big reason. ), therefore, dynamic performance has been greatly improved.
Before you can use an XML object, you must generate an object instance through its constructor, and then manipulate the XML document tree by using its methods and properties. There are two types of constructors for XML objects:
1 new XML (SRC)
Where the parameter src must be well-formed XML text, the following statement first generates an XML object instance by passing in the XML literal, and the two non-static text (TextField object) The contents of the instance Nametextfield and Passwordtextfield are set to "Morgan" and "Loveme", respectively, as follows:
myXML = new XML ("");
Nametextfield.text = MyLogin.attributes.username;
Passwordtextfield.text = MyLogin.attributes.password;
2 new XML ()
Generates an empty XML object instance and then invokes its corresponding method, such as load (), createelement (), createTextNode (), CloneNode (), AppendChild (), and so on, to construct or load an XML document tree. Specific usage can refer to the Flash online help, because the focus of this article is the use of flash socket (socket) connection, so on the XML object based on the HTTP protocol send (), load (), Sendandload () and other methods are not introduced, See below for how to construct an XML document tree.