i'm having trouble wrapping my mind around a flashvars problem. any help would be great.
i have an admin.swf page that writes form data into a MySql db table via a file called save.php
i have a user.swf (embedded in index.php) that needs to display the admin data (via a file called load.php), as well as write new selections to a different MySql db table (via a file called savetake.php).
The trouble: when the admin table is populated, i need to, basically, create an individualized user.swf based on the specific record the admin created. i want to use LaodVars (possibly) to tell the user.swf to use a specific row of data from the table (via the unique id). AKA: "Flash, i need you to use/display the row of data that contains this unique id". i'm not sure what i am doing!
The file called save.php queries the db to get the unique id:
Code:
$result = mysql_query($sql);
$db_id = mysql_insert_id();
The file called index.php contains the FlashVars:
Code:
<param name="movie" value="./master.swf" />
<param name="flashvars" value="<?=$db_id?>"
<param name="quality" value="high" />
<embed src="./master.swf" flashvars="<?=$db_id?>" ...</embed>
SO- in Flash, i don't know how to code for the variable. but i'm starting from here:
Code:
myData = new LoadVars()
myData.load("???????.php?id = db_id", myData);
//Callback handler and binding
myData.onLoad = function(succes){
if(succes){.....
How does Flash know the variable i am passing is intended to tell it which record to use? Which PHP file do i actually call? should i combine some of these PHP files (even if they have different uses and use different tables)? Not to mention, i'm using a master.swf as a MCL for the user.swf- do i put the above code in the master.swf or the user.swf?
i'm ok at this stuff, but this is my first go at this concept, so i am having troubles....
thanks!
alison