show flash using original canvas size dimensions
I have a generalized media player web app that I wish to be able to use flash in. The client uploads the flash to a particular directory, and a webpage is produced automatically that houses that flash file. The output of thi开发者_C百科s process currently looks something like this:
<OBJECT id="flashContent" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<PARAM value="always" name="allowScriptAccess" />
<PARAM value="#FFFFFF" name="bgcolor" />
<PARAM value="opaque" name="wmode" />
<PARAM value="high" name="quality" />
<PARAM value="test.swf" name="movie" />
</OBJECT>
I am trying to get the flash to display using the original canvas size (540 x 400 by default) but every time I load this in chrome I get 300 x 150 and in IE the box is square.
Any idea how to get it to render using the flash canvas size?
Unfortunately, there's no way to do this. You'll either have to know the dimensions ahead of time and set them in the embed, or modify the SWF to expose JavaScript callbacks (with ExternalInterface) and call those.
forget about raw embedding, use js wrapper:
http://code.google.com/p/swfobject/wiki/documentation
snippet is below:
<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
swfobject.embedSWF("myContent.swf", "myContent", "540", "400", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>
精彩评论