Ok. Here's what I've done. This would be in a "filename.php" file on a server that supports PHP:
Code:
<head>
...
<script type="text/javascript" src="swfobject.js"></script>
</head>
<html>
<body>
<?php
$hour = date('g');
?>
<div id="flashOutput">
<!-- This is where your flash movie gets inserted. This content will be replaced -->
</div>
<script type="text/javascript">
var so = new SWFObject("myswf.swf", "output", "550", "200", "8", "#ffffff");
so.addVariable("time", "<?php echo($hour)?>");
so.write("flashOutput");
</script>
...
</body>
</html>
The swfobject stuff is what I use to include my swf movies. It works well, so I've included it. This code assumes that the swfobject.js file is in your directory.
The php code to get the hour of the day is in blue. It's passed (by the javascript) to the swf using the Flashvars object, which is used to pass variables from web pages to Flash movies. The variable "hour" will be avalable on frame 1 of your movie, even though you've never declared it there. Then you can use that variable to find and load the correct image, as djr33 noted above.
Bookmarks