MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuel d'utilisateur Page 145

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 155
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 144
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
142
Availability
Flash Media Server 2
Example
The following example creates an XML packet and then deletes the specified XML object and its descendant nodes:
var xml_str = "<state name=\"California\"><city>San Francisco</city></state>";
var my_xml = new XML(xml_str);
var cityNode = my_xml.firstChild.firstChild;
trace("before XML.removeNode():\n"+my_xml);
cityNode.removeNode();
trace("after XML.removeNode():\n"+my_xml);
/* output (line breaks added for clarity):
before XML.removeNode():
<state name="California">
<city>San Francisco</city>
</state>
after XML.removeNode():
<state name="California" />
*/
XML.send()
my_xml.send(url, [fileObj])
Encodes the specified XML object into an XML document and sends it to the specified URL by using the POST
method in a browser. The Flash test environment uses only the
GET method.
Availability
Flash Media Server 2
Returns
A boolean value;
true if successful, otherwise, false.
Parameters
url A string; the destination URL for the specified XML object.
fileObj A File object, that is not read-only, to which the response is written. If the File object is not open, Flash
Media Interactive Server opens the file, writes to it, and closes it. If the File object is open, Flash Media Interactive
Server writes to the file and leaves it open. This parameter is optional.
Example
The following example defines an XML packet and sets the content type for the XML object. The data is then sent to
a server and the result is written in a File object.
var my_xml = new XML("<highscore><name>Ernie</name><score>13045</score></highscore>");
my_xml.contentType = "text/xml";
my_xml.send("http://www.flash-mx.com/mm/highscore.cfm", myFile);
XML.sendAndLoad()
my_xml.sendAndLoad(url, targetXMLobject)
Vue de la page 144
1 2 ... 140 141 142 143 144 145 146 147 148 149 150 ... 154 155

Commentaires sur ces manuels

Pas de commentaire