# Changing swf file with date. code not working

**URL:** <https://forum.kirupa.com/t/changing-swf-file-with-date-code-not-working/171447>\
**Category:** web dev\
**Created:** [December 5, 2005, 3:41pm UTC](https://forum.kirupa.com/t/changing-swf-file-with-date-code-not-working/171447 "2005-12-05T15:41:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![molotov](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@molotov](https://forum.kirupa.com/u/molotov)\
**Post date:** [December 5, 2005, 3:41pm UTC](https://forum.kirupa.com/t/changing-swf-file-with-date-code-not-working/171447/1 "2005-12-05T15:41:42Z")

</div>

Ok i have a flash file for every day of the month and would like to have some javascript that changes the file rather than update the html everyday.

This is what i have and it’s not working for some reason. any help is greatly appreciated.

\<script language=“JavaScript”\>  
var now = new Date();  
var daynum = now.getDate();  
document.write(’\<param name=“movie” value="/image/tree\_0’ + daynum + ‘.swf"\>’);  
\</script\>

and

\<script language=“JavaScript”\>  
var now = new Date();  
var daynum = now.getDate();  
document.write(’\<embed wmode=“transparent” src"/image/tree\_0’ + daynum + ‘.swf" quality=“high” pluginspage=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)” type=“application/x-shockwave-flash” width=“390” height=“431”\>’);  
\</script\>
