sendScore = new XML(xmlString); sendScore.ignoreWhite = true; sendScore.onLoad = highScoreSend;
var file = "viewScores.do";
sendScore.sendAndLoad(file, sendScore, "POST");
highScoreSend = function (s) { if (s) { // Jeg fik sendt så nu opdaterer jeg mine data igen. } else { gotoAndStop("xmlerror"); } };
Det er den simple form for at send xml fra flash - Du kan også opbygge xml´en mere dynamisk, men så går det hen og bliver en langhåret ting her på eksperten.
Jeg kiggede på AppendChild, som du foreslog, men det virker minus her?....
Example This example does the following things in the order shown:
Creates two empty XML documents, doc1 and doc2. Creates a new node using the createElement() method, and appends it, using the appendChild() method, to the XML document named doc1. Shows how to move a node using the appendChild() method, by moving the root node from doc1 to doc2. Clones the root node from doc2 and appends it to doc1. Creates a new node and appends it to the root node of the XML document doc1. var doc1:XML = new XML(); var doc2:XML = new XML();
// create a root node and add it to doc1 var rootnode:XMLNode = doc1.createElement("root"); doc1.appendChild(rootnode); trace ("doc1: " + doc1); // output: doc1: <root /> trace ("doc2: " + doc2); // output: doc2:
// clone the root node and append it to doc1 var clone:XMLNode = doc2.firstChild.cloneNode(true); doc1.appendChild(clone); trace ("doc1: " + doc1); // output: doc1: <root /> trace ("doc2: " + doc2); // output: doc2: <root />
// create a new node to append to root node (named clone) of doc1 var newNode:XMLNode = doc1.createElement("newbie"); clone.appendChild(newNode); trace ("doc1: " + doc1); // output: doc1: <root><newbie /></root>
Tak for hjælpen nikolaj, vil du lige lægge et svar, så jeg kan lukket spørgsmålet?
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.