I have an ActionScript project set up using the Flash Builder IDE. Using the Flex 4 compiler to compile it. At the top of my application class, I have:
[SWF(width="100%", height="100%")]
public class MediaPlayer extends MovieClip {
This is not acceptable to the compiler to do a release (it throws errors saying it can't parse the width/height values). Pretty annoying. I've tried to do things the "right" way, but none of the following work:
[SWF(percentWidth="100%", percentHeight="100%")]
[SWF(percentWidth="100", percentWidth="100")]
[SWF(widthPercent="100%", heightPercent="100%")]
[SWF(widthPercent="100", heightPercent="100")]
When I use any of those, the stageHeight is 375 (the Flex default) and stageWidth is 500 (default). What is the proper way to do this?
My flash files are being embedded on the web, and I just need the width and height attributes defining the bounds of the flash content to be respected by the SWF.
UPDATE To give a little more context, I don't have control over how this SWF is embedded - it is handled by Facebook code for their in-stream media content.
<div id="u162171_43" style="width:398px;height:259px">
<iframe width="398" height="259" frameborder="0" src="https://s-static.ak.facebook.com/common/referer_frame.php">
<body style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<embed type="application/x-shockwave-flash" src="http://www.rootmusicd.com/flash/fb/rm_player.swf?v=140&d=www.rootmusicd.com&id=102199429820702" width="398" height="259" style="" id="swf_u187610_44" name="swf_u187610_44" bgcolor="#FFFFFF" quality="high" scale="scale" allowfullscreen="true" allowscriptaccess="never" salign="tl" wmode="opaque" flashvars="bridge_connection_id=_conn_4d9b46f8c10ea6089493440&payer_connection_id=_payer_4d9b46f8c10f64d23500210&width=398&height=259">
</body>
</iframe>
</div>
So the width and height attributes are being explicitly set to numbers here. I don't know much about the 'scale' attribute; maybe it is coming in to play here? And, to be clear: it will work as expected if I set the [SWF] meta tag to have width "100%" and height "100%"... so it seems like it actually is preferring the compiled arguments over the browser environment. Perhaps there are other settings I am missing?