Java/js to obtain the specific method of flash high width _javascript skill

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.