Resizing In Full Screen

http://www.h2.com.tw/eng/indexpc.htm

In that website, how do they keep some of the movieclip items locked on the edge of the screen? When you resize your screen, the items on the edges are the ones that moves correspondingly. And the fillers are near the middle part. How cool! BUT HOW?

Thanks.

Andre

Since Flash 8 (and 7, not sure) you have a Stage object, to which you can add listeners that respond to the onResize event. That way you can react to stage resize events in any way you like.

Should you be using an older version you can use the event in javascript which responds to a window resize (which is about the same) to call a flash function to react in the same manner.

Thank you for your reply, could you or anyone give a quick actionscript write up on this? :goatee:
Thanks.

Hey, basically what you want to do is make use of the stage height/width property. For example I have a gradient background that changes size according to stage size:

Hey, basically what you want to do is make use of the stage height/width property. For example I have a gradient background that changes size according to stage size:

onClipEvent (enterFrame) {
this._width = Stage.height;
this._height = Stage.height;
}

Thanks for the reply, this is being discussed as well in the actionscript forum: kirupaForum

So my code would be something like this:

this._x = Stage.width;
this._y = Stage.height;

But wouldn’t that only align it to one corner? How about the other corner?

you want it to be in the enterframe event thing, that way if you resize your browser window it updates.

the location of anything can be controlled by movieclipname._x and ._x, and considering you know the size of your stage you can position anything where you like. If you wanted something at the bottom left of the screen the movieclip actionscript would be:

onClipEvent (enterFrame) {
this._x = 0;
this._y = (Stage.height - this._height);
}