snapple
07-23-2004, 02:32 PM
Hello,
I have been filling the hours of my recent days with a drawing application i am building. I would really appreciate someone who has a better grasp [than me] on Flash > php matters to point out to me why the following is not working.
The application already sends and loads loads of data to and from MySQL, but for some reason (and i have tried to battle it out) - the following variables are not showing in Flash.
My Actionscript is as follows:
_root["userCoord||"+g].onRelease = function ()
{
image_lv = new LoadVars();
image_lvBack = new LoadVars();
image_lv.varName = getUser(this._name, storeNames);
image_lv.myNamesX = myNamesX;
image_lv.onLoad = function (checkPlease)
{
if(checkPlease)
{
//trace("loadVars worked");
}
}
image_lv.sendAndLoad("http://localhost/genDraw_x.php", image_lvBack, "POST");
//trace(image_lvBack.varName);
}
myHeight +=18;
}
}
What i would like to do is send the variable 'varName' to php, this then tells php which row of data to pull from the database. My php is as follows:
$varName = $_POST['varName'];
$myNamesX = $_POST['myNamesX'];
$tmpStrX = "";
$resData = mysql_db_query ("images","SELECT draw_x, FROM draw WHERE draw_name = '$varName'");
while ($entry = mysql_fetch_array ($resData))
{
$tmpStrX = $tmpStrX . $entry["draw_x"] . ",";
}
mysql_free_result($resData);
print "varName = $varName";
print "myNamesX = $tmpStrX";
?>
I have about 7 other variables but i have just left them out for ease of reading. varName needs to be sent to Flash and interpreted, where as all i need to do for myNamesX is load the x_coordinates from the database.
What i don't understand, is when or how to definitely recognise when Flash can seperatley load in variables from a php file, whilst sending them, or when to call them in flash. I am very annoyed with myself, because i have successfully, inserted all the data into the db, successfully, brought back data from the database, put it into arrays etc, etc - but this crucial part is messing me around.
Many, many thanks for any help. I have been working on this non stop for quite a while now and thought i had Flash > php > Flash vars sorted..perhaps not.
Thank you very much in advance. Regards, snapple :)
I have been filling the hours of my recent days with a drawing application i am building. I would really appreciate someone who has a better grasp [than me] on Flash > php matters to point out to me why the following is not working.
The application already sends and loads loads of data to and from MySQL, but for some reason (and i have tried to battle it out) - the following variables are not showing in Flash.
My Actionscript is as follows:
_root["userCoord||"+g].onRelease = function ()
{
image_lv = new LoadVars();
image_lvBack = new LoadVars();
image_lv.varName = getUser(this._name, storeNames);
image_lv.myNamesX = myNamesX;
image_lv.onLoad = function (checkPlease)
{
if(checkPlease)
{
//trace("loadVars worked");
}
}
image_lv.sendAndLoad("http://localhost/genDraw_x.php", image_lvBack, "POST");
//trace(image_lvBack.varName);
}
myHeight +=18;
}
}
What i would like to do is send the variable 'varName' to php, this then tells php which row of data to pull from the database. My php is as follows:
$varName = $_POST['varName'];
$myNamesX = $_POST['myNamesX'];
$tmpStrX = "";
$resData = mysql_db_query ("images","SELECT draw_x, FROM draw WHERE draw_name = '$varName'");
while ($entry = mysql_fetch_array ($resData))
{
$tmpStrX = $tmpStrX . $entry["draw_x"] . ",";
}
mysql_free_result($resData);
print "varName = $varName";
print "myNamesX = $tmpStrX";
?>
I have about 7 other variables but i have just left them out for ease of reading. varName needs to be sent to Flash and interpreted, where as all i need to do for myNamesX is load the x_coordinates from the database.
What i don't understand, is when or how to definitely recognise when Flash can seperatley load in variables from a php file, whilst sending them, or when to call them in flash. I am very annoyed with myself, because i have successfully, inserted all the data into the db, successfully, brought back data from the database, put it into arrays etc, etc - but this crucial part is messing me around.
Many, many thanks for any help. I have been working on this non stop for quite a while now and thought i had Flash > php > Flash vars sorted..perhaps not.
Thank you very much in advance. Regards, snapple :)