PDA

View Full Version : Help on recieveing variables from php



Enix591
June 6th, 2005, 03:41 PM
alright ive searched and ive read tutorials and i still dont know how to load variables from a php file and put them in a list(ui component).

In my flash i declared the new Loadvars object, set some variables(Test1,Test2,Test3), sent them to the php file, in the php file i changed their values,and now i want to load into flash the changed variables,and put them into a list component.
This is my flash code.



MyObject = new LoadVars();
MyObject.Test1 = "JJ";
MyObject.Test2 = "Anthony";
MyObject.Test3 = "Kelly";

//Buttons//
SendPhp.onRelease = function() {
MyObject.send("PhpTest.php", "_blank", "POST");
};

RecievePhp.onRelease = function() {
MyObject.load("Phptest.php");
};

//Adding to list//
MyObject.onLoad = function(success) {
if (success) {
MyList.addItem(MyObject.Test1);
MyList.addItem(MyObject.Test2);
MyList.addItem(MyObject.Test3);
} else {
MyList.addItem("Error");
}
};

abcdefg
June 6th, 2005, 08:14 PM
MyObject = new LoadVars();
Test1 = "JJ";
Test2 = "Anthony";
Test3 = "Kelly";

//Buttons//
SendPhp.onRelease = function() {
MyObject.send("PhpTest.php", "_blank", "POST");
};

RecievePhp.onRelease = function() {
MyObject.load("Phptest.php");
};

//Adding to list//
//MyObject.onLoad = function(success) {
//if (success) {
MyList.addItem(Test1);
MyList.addItem(Test2);
MyList.addItem(Test3);
//} //else {
//MyList.addItem("Error");
//}
//};


I commented out a lot of stuff because I didn't have the php page so obviously all I was getting was error.