PDA

View Full Version : how to play a swf movie file while the gamemap was playing


marty6
12-27-2010, 04:52 PM
Hi,

I've recently got a small website up and running w/ a game server and a mysql server for collecting data. The game has various maps being played on it. I was trying to figure out how to play a swf movie file while the gamemap was playing. For example...if the 'mapname' was called 'map1' then somehow php would query the '$mapname' called 'map1' and then on the index page of the web site map1.swf file would be playing. Then if map2 were loaded or rather playing on the game server, then 'map2.swf' file would be playing on the index page.

Is this possible?

I'm willing to learn if someone is willing to teach!
Thanks,
marty6

Update:
Here is some coding from one of the php pages that I'm writing:

page3.php
<?php

$moviePath = "movie";

$map = $val["mapname"];
$map = strtolower($map);

switch($map)
{
default :
$fn = str_replace(" ","_",$map);
$fn = strtolower($fn).".swf";
if(file_exists("$moviePath/$fn")) {
$filename = $fn;
} else {
$filename = ""; //<-- DON'T KNOW WHAT TO PUT HERE
if(stristr($val["mapname"],"map1"))$filename = "map1.swf";
if(stristr($val["mapname"],"map2"))$filename = "map2.swf";
}
}

$path_to_mappick = "$moviePath/$filename";

?>


Page2.php
<?php
$url = $_SERVER["PHP_SELF"]."?IP=$pip&sort=$sort&port=$port&liteTag=$liteTag&mode=$mode";
?>
<TABLE>
<img src="<?php echo $path_to_mappick; ?>" <?php if($force_pictures_to_default) echo "width='320' height='240'"; ?>><strong><font class="smallFont" ><br>
map</font></strong><font class="smallFont" >: <?php echo $val["mapname"]; ?></font></td>
<td>&nbsp;</td>
</TABLE>
?>

What is highlighted in black is wrong. What I would like to do is to have a way to play swf file while the map being queried on page3.php. I don't know how to link or rather add a player and have it have the ability to play any map.swf file queried.

marty6
12-28-2010, 02:34 AM
Trying to edit my post above somehow did not work for some reason. Well, I finally got it to work.
Please close this post!
marty6

CyanBlue
12-28-2010, 03:18 AM
Howdy... ;)

Glad to hear that you have found a solution... It'd be great if you could share the solution so that other people can learn from it as well... As a matter of fact, this is a place where everybody learn from everybody else... ;)