PHP & HTML Flash Object Help

chrisrac

New Member
Messages
4
Reaction score
0
Points
1
Hey,

I am currently working on a website that will include flash games however I have encountered the problem with the flash game not actually appearing the dimensions on the website change however the game doesn't show (http://chrisracer24.x10.mx/index.php?action=test)

In test.php I have this code:
Code:
<?php
$game = 'content/games/age-Of-War-616.swf';
require_once 'required/game.php';
?>
In game.php I then have this code:
Code:
    <center>
      <div id="flashContent">
       <object width="720" height="550">
       <param name="movie" value="<?php echo $game ?>">
       <embed src="<?php echo $game ?>" width="720" height="550">
       </embed>
		  <a href="http://www.adobe.com/go/getflash">
		    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="720" height="540" />
	      </a>
	    </object>
	  </div></center>

I have tried various methods to get this to work such as implementing the object just as HTML without the php. Other files on my website add the associated content such as the header and footer and that has been working fine. I would appreciate any help on this :)

Regards,
Chris :)
 
Last edited:

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
You need to echo $game. Your script, as it stands, sort of acknowledges the existence of $game, but it's not telling the system to output it as text.
 
Last edited:

chrisrac

New Member
Messages
4
Reaction score
0
Points
1
Thanks, I have now echoed $game however it still doesn't appear to be working. Everything that needs to be there is on the webserver.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Have you tried the simple expedient of creating a static HTML page that does what you want, then comparing that to the source output of your PHP (using view source in the browser)? Do you have your file path correct? (And you still haven't got the echo in the <embed>, so the src is empty.)
 

chrisrac

New Member
Messages
4
Reaction score
0
Points
1
While I may not have updated the OP with the echo due to time constrants I did have the time to do it to the file itself on the webserver through notepad++. I am going to test the html later on as I'm currently on my phone at the moment. The file paths are also set from the site root as that's where my index.php is however the other pages that it calls upon are in /content/pages/

Edit: I have now got it working thanks for the help :)
1) I forgot to echo the embed src for the $game variable
2) I misspelt the name of the swf file
 
Last edited:

johncruz

Banned
Messages
10
Reaction score
0
Points
0
By specifying the argument as 1 resolved the issue:


/*set the size of the screen on which flixel will draw*/ super(640,480,PlayState,1,50,50);

I think this will help you.
 
Top