snapple
07-21-2004, 06:24 PM
Hello,
I am building a drawing application where people can save their drawings and then other people can 'replay' them later on. Variables such as name, x, y,colour, alpha and pen thickness etc are stored in 6 separate arrays and sent to php and stored in 1 table in a mysql database - this is all working fine.
So far i have the names (sent from an input textfield in flash) being echoed in php from the database:
Andrew, James, Simon, Charlotte, Amy
What i would like to do is get these names back to flash in an array. What would be the best way of achieving this? I have tried (not successfully) sending an empty array, from flash, to php and populating it and then sending it back to flash.
So say i have the following actionscript:
var imageArray = new Array();
_root.saveCo.onRelease = function ()
{
imageSend = new LoadVars();
imageBack = new LoadVars();
imageSend.recData = imageArray;
//i have the (success) argument in flash - just not here.
imageSend.sendAndLoad("http://localhost/swftest.php", imageBack, "POST");
}
I am stuck as to how to send it (empty) to php > populate it and send it back to flash. I would really be very grateful for any help regarding this problem.
This is only one of my 'personal' projects (that appears to turn less fun everyday), so don't stress about time.
Thank you once again for your time and effort.
Best regards, snapple :)
I am building a drawing application where people can save their drawings and then other people can 'replay' them later on. Variables such as name, x, y,colour, alpha and pen thickness etc are stored in 6 separate arrays and sent to php and stored in 1 table in a mysql database - this is all working fine.
So far i have the names (sent from an input textfield in flash) being echoed in php from the database:
Andrew, James, Simon, Charlotte, Amy
What i would like to do is get these names back to flash in an array. What would be the best way of achieving this? I have tried (not successfully) sending an empty array, from flash, to php and populating it and then sending it back to flash.
So say i have the following actionscript:
var imageArray = new Array();
_root.saveCo.onRelease = function ()
{
imageSend = new LoadVars();
imageBack = new LoadVars();
imageSend.recData = imageArray;
//i have the (success) argument in flash - just not here.
imageSend.sendAndLoad("http://localhost/swftest.php", imageBack, "POST");
}
I am stuck as to how to send it (empty) to php > populate it and send it back to flash. I would really be very grateful for any help regarding this problem.
This is only one of my 'personal' projects (that appears to turn less fun everyday), so don't stress about time.
Thank you once again for your time and effort.
Best regards, snapple :)