-
Flash, XMP and PHP
Evening everyone,
I am having a bit of trouble getting my head around this XML into flash then editing with PHP business. Is there a tutorial anywhere that can help me with this problem?
I’m basically after getting flash to show certain XML data, being allowed to modify the value of certain XML data and then saving changes to the XML file.
I know this is done with the help of PHP but I can’t seem to find anything tutorial wise to help me with this, anyone got any advice/links? All help appreciated in advance.
-
FK'n_dog
-
Originally Posted by a_modified_dog
Thanks dog, i'll have a look
-
eermrrmmm ok I think I have it now....in a sence lol
It seems to be sending the information and the PHP element is opening the file, only problem is it wipes the document :-( any ideas what I have done wrong, here my AS code
Code:
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = processXML;
var RootNode:XMLNode;
myXML.load("chart.xml");
function processXML(success:Boolean):Void {
if (success) {
RootNode = myXML.firstChild.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
}
else {
trace ("Error loading XML file");
}
}
myBut.onRelease = function(){
myXML.sendAndLoad("save.php", myXML);
}
and heres my PHP code
Code:
<?php
$file = fopen("chart.xml", "w+"); //the w+ mode truncates the file to 0 length for us :)
$xmlString = $_GLOBALS["HTTP_RAW_POST_DATA"]; //you need to use this with xml.send()
print "XML:".$xmlString."\n";
if(!fwrite($file, $xmlString)){
print "Error :(";
}
fclose($file);
?>
-
FK'n_dog
hmmm... no idea why your file fails
my file is working OK. can you simulate my set-up ?
when you see that working, try modifying to your needs
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|