Widget.onResize

Availability

Flash Player 7 + TheSpringBox V1

Usage

Widget.onResize = function(width:Number, height:Number) : Void {
// your statements here
}

Parameters

width - The width the window is set to.

height - The height the window is set to.

Returns

Nothing.

Description

Event handler; invoked whenever the size of the wrapper is altered, either by the user via the resize button or when triggared by code. You should respond to this handler by calling an arrange function that rescales the chrome of your widget.

Example

The function below could be used to toggle the settings panel of a particular widget:

Widget.onResize = function(w,h) {
  //Resize Background MovieClip
  mcBackground._width = w;
  mcBackground._height = h;
  //Center Logo MovieClip
  mcLogo._x = Math.round( (w - mcLogo._width) / 2 );
};