Js:
Setting the embed height and width can change the height and width of the flash, thereby gaining.
Copy Code code as follows:
<! DOCTYPE html>
<body>
<embed src= "test550x400.swf" id= "Flash" width= "550px" height= "400px"/>
<script type= "Text/javascript" >
var flash = document.getElementById ("flash");
Alert ("Wide:" +flash.width+ "High:" +flash.height);
</script>
</body>
Java:
Java parsing Flash file header information can be the size of flash, you need to pay special attention to the two types of flash: Fws,cws. CWS data is part of the flash after the zlib compressed form, before parsing needs to extract first.
For FWS type of flash, the header information contains dimension information, which is resolved as follows:
The first three bytes identifies the type of Flash (FWS/CWS);
The 5,6,7,8 byte is the size of the Flash file;
Reads 5 bits from the 9th byte, sets the value to N, crosses n bits, reads n bits, sets the value to X, skips n bits, reads n bits, and sets the value to Y. The width and height of the SWF are x/20 and y/20 pixels in turn