I am having a problem passing the values of functions and variables into flash.

I got this no problem
<PARAM NAME="MOVIE" VALUE="flash_home.swf?docWidth=test">
<EMBED NAME="testcommand" SRC="flash_home.swf?docWidth=test">

But I need to do something like this.
<PARAM NAME="MOVIE" VALUE="flash_home.swf?docWidth="+getDocWidth()>

Does this make sense? This is one of my first tries with passing values to flash.