Browser | Adaptive to let flash adaptive browser screen size needs to do the following two points:
1, the SWF file with the browser screen size also changed greatly under;
Methods: In the Web page, in addition to putting your SWF file, do not put any other content, and SWF file width, height is set to 100%;(can look at my source files in the fullscreen.htm file);
2, when the SWF file size changes, the Flash content is also rescheduled accordingly.
In this example, I used a loader component on the main stage to load a picture. When you resize the browser, the SWF file changes in size. I used the Onreisize event of the stage object to change the size and position of the loader component.
source File Download In the source file I do not write too much code, I believe you can easily read.
++++++++++++++++++++++++++++++++++++++
The second method:
++++++++++++++++++++++
The first is:
In the Web page, the Flash is set to 100% high and wide.
Add in Flash
Stage.scalemode = "Noscale";/this is a must.
Stage.align = "TL";
Then, there are two methods:
1, through System.capabilities.screenResolutionX and System.capabilities.screenResolutionY to get the screen size, and then adjust the corresponding display in flash, relatively simple.
2, this is better, every time you resize the browser will trigger, but also detected in the browser stage size, more accurate.
fullscreen = new Object ()///Create Class
Fullscreen.onresize = function () {//swf is triggered when size changes
box._x = stage.width-300;//Adjusts the display according to the width and height of the stage obtained by Stage.width and Stage.height
};
Stage.addlistener (fullscreen);
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