Hi there,
I’m trying to save a change to a text document (In this case a variable “Title” just to test) and then view the changes from another swf movie…
In the end I’m hoping to build a client updatable flash site. In particular menu items… feature items & prices.
A Recap: a client types in the items, php/flash saves the changes to the text document, and site visitors can views those changes.
Something in my code isn’t clicking:
My PHP is:
<?php
$Title = $_POST['Title'];
$toSave = "Title=".$Title;
//Open a file in write mode
$fp = fopen("content.txt", "w");
if(fwrite($fp, $toSave)) echo "writing=Ok";
else echo "writing=Error";
fclose($fp);
?>
My ActionScript is
submit.onPress = function(){
if(Title.text!=""){
myData.Title = Title.text
myData.sendAndLoad("save.php", myData, "POST")
}
}
myData = new LoadVars()
myData.onLoad = function(){
if(this.writing=="Ok") {
gotoAndStop(2)
status.text = "Submited data was saved"
}
else status.text = "Error in saving submitted data"
}
stop()
I’ve been told to try more simple code like
this.loadVariables("save.php";"POST");
But I’m not sure where to put it?!
- B