Groups | Blog | Home
all groups > flash data integration > december 2005 >

flash data integration : PHP variable into Flash


2hitek
12/30/2005 8:46:17 AM
Here's the issue:
We need to be able to read in a variable from a link directly into a flash
file.


So for example, if our server sent you a link with an email containg the
following link:

http://www.ourdomain.com/whatever.php?id=12345

And let's say that our flash movie is embedded into the whatever.php file.
How can I get Flash to read in that,

id=12345

I know how to use LoadVars() and the methods with it all, no problem from that
end. The only issue is that we're not really contacting another script to do a
sendAndLoad() operation. We just need to read in what the value of 'id' is so
that when the flash file first loads up, it will detect if in fact there is an
id available that it needs to hunt back in mysql for the appropriate data.
Looked on US and couldn't really find what I was looking for exactly.

Thanks for the help,
-Ninu
kaunietiz
12/30/2005 10:15:33 AM
You could use JavaScript to get that value and pass it to Flash. Have a look here:

Motion Maker
12/30/2005 12:15:25 PM
Look at FlashVars in the OBJECT and EMBED tags.

Same as passing on the URL line except they do not appear up there and thus
less obvious. You thus use PHP to form some of the OBJECT and EMBED tag
return to slice in the id value.

echo '<param name="FlashVars" value="id=12345" />';

echo '<embed flashvars = "id=12345" .....';

or
echo '<param name="FlashVars" value="id=' . $idValue . '" />';

echo '<embed flashvars = "id=' . $idValue . '" .....';

Example used in seminars I conduct:

http://www.hosfordusa.com/ClickSystems/courses/flash/examples/FlashVars/Ex01/FlashVarsEx01.php


--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
Here's the issue:
We need to be able to read in a variable from a link directly into a flash
file.


So for example, if our server sent you a link with an email containg the
following link:

http://www.ourdomain.com/whatever.php?id=12345

And let's say that our flash movie is embedded into the whatever.php file.
How can I get Flash to read in that,

id=12345

I know how to use LoadVars() and the methods with it all, no problem from
that
end. The only issue is that we're not really contacting another script to do
a
sendAndLoad() operation. We just need to read in what the value of 'id' is
so
that when the flash file first loads up, it will detect if in fact there is
an
id available that it needs to hunt back in mysql for the appropriate data.
Looked on US and couldn't really find what I was looking for exactly.

Thanks for the help,
-Ninu

AddThis Social Bookmark Button