-
PHP embedding problem
I'm using PHP to embed a swf file into a webpage. The problem is that before the swf shows anything (i.e. the preloader doesn't load) the swf has to completely load. Is there a way to force the swf to show the preloader before the swf has completely loaded?
-
You're mentioning PHP as if it's causing the problem. Does it work fine in HTML?
-
Yes, if I embed the swf using HTML, it works fine.
-
In theory if you just create HTML page with PHP it should behave exactly same as having separate html file.
-
Code:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"
WIDTH=<?php echo $gameWidth; ?> HEIGHT=<?php echo $gameHeight; ?>>
<PARAM NAME=movie VALUE="<?php echo $filename; ?>">
<PARAM NAME=menu VALUE=false>
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE="<?php echo $bcol; ?>">
<PARAM NAME=FlashVars VALUE="movie=<?php echo $gameName; ?>&id=<?php echo $gameID; ?>">
<EMBED src="<?php echo $filename; ?>" FlashVars="movie=<?php echo $gameName; ?>&id=<?php echo $gameID; ?>" menu=false quality=high bgcolor="<?php echo $bcol; ?>" WIDTH=<?php echo $gameWidth; ?> HEIGHT=<?php echo $gameHeight; ?> TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
This is the code I am using to embed the swf.
-
well make that entire block as a string and and echo that no?
$flashEmbed = "<object classid....</object>"
echo $flashEmbed
-
I'm with Tony, using PHP shouldn't make any difference if everything is done correctly, even doing little echoes everywhere like you are doing.
You can compare the output of the PHP page to the regular HTML and see what's different, that should give you a clue to what's going wrong.