Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-30-2007, 09:54 PM   #1
batesa
trying really hard...
 
Join Date: Jan 2007
Location: detroit
Posts: 3
Question flashvars, PHP

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
batesa is offline   Reply With Quote
Old 01-30-2007, 10:03 PM   #2
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

the flashvar will be on the _root timeline. So if you called, john, it would be _root.john
__________________
Color Wars™ | (kul′ər wôrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
writing to text file via php using LoadVars victor322 ActionScript 2.0 5 05-10-2006 03:42 AM
LoadVars or XML with PHP on DIFFERENT servers doesn't work. Sckz Server-Side Scripting 4 07-14-2005 12:01 AM
php and flashvars endzyme Simple Stuff (Newbies) 6 04-15-2005 04:52 PM
how to link Action Script to a remote PHP atomskreymx Server-Side Scripting 2 11-16-2004 07:01 AM
escaping ASCII characters >127 in FlashVars with php urlencode ? _marabout_ ActionScript 1.0 (and below) 15 05-11-2004 09:12 AM


All times are GMT. The time now is 08:40 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.