var w=window.innerWidth, h=window.innerHeight;
document.write('<object width="' + w + '" height="' + h + '">');
document.write(' <param name="movie" value="x.swf">');
document.write(' <embed src="x.swf" width="100%" height="100%"></embed>');
If you need to dynamically resize whenever the window is resized then you can attach a handler to the window.onresize event which retrieves the necessary object and embed DOM elements and change their width and height properties. Probably. I haven't tested any of this.
The method for retrieving the window width/height will probably vary per browser but I'm sure you can find a reliable, cross-browser way to do it somewhere online.
Why would you do this instead of just embedding at size "100%"?