Hey there guys,
After some research into PHP and Actionscript, I think I have come close to doing what I want to do. Except now I'm stuck.
Here is what I have in my header.php file:
<?php
$c_page = $_SERVER['PHP_SELF'];
$c_page = basename($c_page, ".php");
?>
So I have the current file name of the php page stored in a variable called $c_page. Right?
I want to pass it on to a single Flash file, which looks like this:
<object align="middle">
<param name="quality" value="high" />
<param name="movie" value="swf/index.swf?<? echo "cPage=$c_page"; ?>" />
<embed src="swf/index.swf?<? echo "cPage=$c_page"; ?>" quality="high" width="780" height="440" align="middle"></embed>
</object>
Now I want to dynamically load a different background image depending on which page the swf file is in.
But when I add this:
_root.bgHostAnim_MC.bgHost_MC.loadMovie('../images/'+cPage+'Bg.jpg');
to the parent of the movieclip that I want to load the image into, it won't recognise cPage as a variable and comes back as undefined.
Can anyone help?
Cheers.
|
|
June 15th, 2008 04:44 PM
# 2
|
Re: How to get vars from PHP into Flash
Also, in case this helps..
When I go to preview the swf, Flash gives me an error:
Error opening URL 'file:///....images/undefinedBg.jpg'
Which I understand because flash needs to get the data from the php file.
So I then refresh my browser. But the swf still file doesn't find the image.
It's called indexBg.jpg so it should work with the bit of actionscript I have but I still don't get it..
Any help much appreciated
|
|
July 2nd, 2008 07:25 PM
# 3
|
Re: How to get vars from PHP into Flash
Hello,
Passing variables to flash is not too difficult. Based on the code you put up their I think you are just missing a few lines to have it recognize the variable (flashvar). See this link for more information.
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16417
Thanks
Not the answer you were looking for? Post your question . . .
183,940 Experts ready to help you find a solution.
Sign up for a free account, or
Login (if you're already a member).