The "Full browser screen" Flash project with tweening
"Full screen" or "full browser screen" Flash websites became a standard on the web now. And it's actually very easy to create such a website as ActionScripts 3 provides us with RESIZE event to track size changes of the Flash Player window or the internet browser. Actually, all we need to do is just adjust x and y properties of our display object or resize any background to fit the resized window.
HERE you can see an examle of a "full browser" Flash project.
Remember to resize the browser window to see the actual effect.
I have placed three MovieClips, called leftBox_mc, middleBox_mc and rightBox_mc on the stage of my project. Aim was to keep the leftBox on the top left corner of the scene, the middleBox in the middle and the rightBox on the bottom right corner. I also wanted to animate movement of middleBox, so it would respond to the resize event with some delay.
First step is to declare that we don't want any scaling and that the 0,0 coordinates are in the left top corner of the stage. Then we set the listener for RESIZE event and the handling function that will adjust the MovieClips positions. We will use tweening to change the middleBox position.
1 |
import flash.display.MovieClip; |
Now if you compiled your project and resized the Flash Player window, you probably also noticed that the MovieClips changed their positions on the screen. So this is what we wanted. The next step is to publish your project along with html file that will display your Flash in a full browser size (Publish Settings -> HTML -> Dimension - percentage 100%):

When opening just created website in a browser, you probably noticed that actually there is still some border around the embedded Flash. To get rid of that, just add the CSS stylesheet to the HTML file and reset the body margins, paddings and borders as below:
1 |
body { |


Comments