mohittaunk
03-04-2009, 10:48 AM
Dear all,
I have a problem in sending an array from flash to PHP. I am collecting the value an array clicking button1. It is working. But When i send after clicking the button2. Value is not go to PHP.
Here is my code:
circle.onPress = function(){
this.startDrag();
}
circle.onRelease = function(){
this.stopDrag();
this._x = _root.xvalue = _root._xmouse;
this._y = _root.yvalue = _root._ymouse;
}
playerName = new Array();
Xvalue = new Array();
Yvalue = new Array();
c = 0;
set_player.onRelease = function(){
playerName[c] = crt_player.text;
Xvalue[c] = xx.text;
Yvalue[c] = yy.text;
trace("Value "+c);
trace(playerName[c]);
trace(Xvalue[c]);
trace(Yvalue[c]);
c++;
}
function submitDataToTextfile() {
submittedData = new Array();
submittedData.inputName = playerName;
submittedData.inputX = Xvalue;
submittedData.inputY = Yvalue;
response = new LoadVars();
response.onLoad = doThisOnResponse;
submittedData.sendAndLoad("http://localhost/practice/sendData/careTaker.php", response, "post");
};
function doThisOnResponse(result) {
if(result){
responsetxtb.text = response.receivedData;
statustxtb.text = response.writeStatus;
}else {
trace("everything went wrong...aaghhh..damn this");
};
};
submit.onRelease = function() {
submitDataToTextfile();
};
I don't know where i am wrong?
Please help.
Thanks
mohit
I have a problem in sending an array from flash to PHP. I am collecting the value an array clicking button1. It is working. But When i send after clicking the button2. Value is not go to PHP.
Here is my code:
circle.onPress = function(){
this.startDrag();
}
circle.onRelease = function(){
this.stopDrag();
this._x = _root.xvalue = _root._xmouse;
this._y = _root.yvalue = _root._ymouse;
}
playerName = new Array();
Xvalue = new Array();
Yvalue = new Array();
c = 0;
set_player.onRelease = function(){
playerName[c] = crt_player.text;
Xvalue[c] = xx.text;
Yvalue[c] = yy.text;
trace("Value "+c);
trace(playerName[c]);
trace(Xvalue[c]);
trace(Yvalue[c]);
c++;
}
function submitDataToTextfile() {
submittedData = new Array();
submittedData.inputName = playerName;
submittedData.inputX = Xvalue;
submittedData.inputY = Yvalue;
response = new LoadVars();
response.onLoad = doThisOnResponse;
submittedData.sendAndLoad("http://localhost/practice/sendData/careTaker.php", response, "post");
};
function doThisOnResponse(result) {
if(result){
responsetxtb.text = response.receivedData;
statustxtb.text = response.writeStatus;
}else {
trace("everything went wrong...aaghhh..damn this");
};
};
submit.onRelease = function() {
submitDataToTextfile();
};
I don't know where i am wrong?
Please help.
Thanks
mohit