PDA

Click to See Complete Forum and Search --> : Loading fresh flash with javascript



swak
02-25-2007, 10:38 AM
I want to keep the computer from loading an swf from chache. Any ideas how to do that? I've been trying to load it by attaching the date to the end like this: example.swf?1324 but for some reason my script doesn't work which is:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>AirportTransparencyViewer</title>
</head>
<body bgcolor="#000000">
<SCRIPT LANGUAGE="JavaScript">
var now = new Date();
var today = ""+now.getFullYear() + now.getMonth() + now.getDay() + now.getHours() + now.getMinutes() + now.getSeconds();
</script>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="456" id="AirportTransparencyViewer" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="AirportTransparencyViewer.swf?"+today /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="AirportTransparencyViewer.swf?"+today quality="high" bgcolor="#000000" width="800" height="456" name="AirportTransparencyViewer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>

Could someone please help me out here. I'm not sure on how to proceed. The name of the swf is AirportTransparencyViewer.swf

swak
02-25-2007, 05:41 PM
Does anyone have any ideas? It doesn't have to be javascript specifically. I just want something to load from my website and not from the cache.

jAQUAN
02-26-2007, 06:12 AM
For one you should be using this to place your .swf in the first place.
http://blog.deconcept.com/swfobject/

When you do, just tack on the date to the .swf


<div id="flashcontent"><a href="http://www.macromedia.com/go/getflash/">get flash player</a></div>
<script type="text/javascript">
var now = new Date();
// <![CDATA[
var so = new swfbject("AirportTransparencyViewer.swf?"+now, "AirportTransparencyViewer", "800", "456", "8.0.22", "#000000", true);
so.addParam("allowScriptAccess","sameDomain");
so.addParam("align","middle");
so.write("flashcontent");
// ]]>
</script>

swak
02-26-2007, 07:02 AM
Thanks.