Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write to XML file using flash mx 2004 Pro

Status
Not open for further replies.

wikfx

IS-IT--Management
Dec 16, 2001
196
MT
Can anyone tell me how I can write to an xml file using flash mx 2004. Thanks

WiK

W i K
 
Hi WiK,

You could try something like this:

Code:
fBuildXML = function(Outgoing_str){

	Outgoing_str = "<ParentNode>"
	Outgoing_str = Outgoing_str + "<ChildNode1>" + "Child Node 1 Data" + "</ChildNode1>";
	Outgoing_str = Outgoing_str + "<ChildNode2>" + "Child Node 2 Data" + "</ChildNode2>";
	Outgoing_str = Outgoing_str + "</ParentNode>";

	return Outgoing_str;
}

fCreateFile = function(){
	var Outgoing_xml:XML = new XML();
	var Incoming_xml:XML = new XML();
	var tOutgoing_str:String = fBuildXML(tOutgoing_str);
	OutGoing_xml.xmlDecl = "<?xml version='1.0' encoding='utf-8'?>";
	OutGoing_xml.parseXML(OutGoing_str);

	//and either 
		OutGoing_xml.sendAndLoad("url",Incoming_xml);
	//or
		Outgoing_xml.send("url");
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top