Main Page | Packages | Class Tree | Index | Help

com.bjc.resizers

class Resizer

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.resizers.Resizer


class Resizer
extends BJCComponent

Enables smooth horizontal and vertical resizing of a predefined graphic element, keeping the four corners the same and stretching the middle. This is useful when you have a shape with curved or irregularly shaped edges, and you don't want the curves to stretch out. It is recommended that you use HResizer or VResizer where resizing in only one direction is needed, as they are far simpler and more efficient.


Author:
Flashloaded - www.flashloaded.com

Example:
attachMovie("Resizer", "panel", 0);
panel.skin = "panelSkin";
panel.topMargin = 20;
panel.bottomMargin = 20;
panel.leftMargin = 20;
panel.rightMargin = 20;
panel.setSize(500, 500);


Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
bottomMargin: Number (write)
Sets how much of the bottom of the graphic will not be stretched. Default value is 20 pixels.

public
bottomMargin: Number (read)
Gets how much of the bottom of the graphic will not be stretched.

public
leftMargin: Number (write)
Sets how much of the left hand side of the graphic will not be stretched. Default value is 20 pixels.

public
leftMargin: Number (read)
Gets how much of the left hand side of the graphic will not be stretched.

public
margin: Number (write)
Sets the topMargin, bottomMargin, leftMargin and rightMargin to the same value.

public
margin: Number (read)
If all four margin values are equal, returns their value, otherwise returns undefined.

public
rightMargin: Number (write)
Sets how much of the right hand side of the graphic will not be stretched. Default value is 20 pixels.

public
rightMargin: Number (read)
Gets how much of the right hand side of the graphic will not be stretched.

public
skin: String (write)
Sets the skin to be used in the resizer. This is a string set to the linkage name of a movie clip containing a graphic. The movie clip must be set to export.

public
skin: String (read)
Gets the skin used in the resizer.

public
topMargin: Number (write)
Sets how much of the top of the graphic will not be stretched. Default value is 20 pixels.

public
topMargin: Number (read)
Gets how much of the top of the graphic will not be stretched.

Properties inherited from class com.bjc.core.BJCComponent

disabledAlpha, enabled, focusTime, height, keyEnabled, style, width

Constructor

public
Resizer ( Void)


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): Resizer
Static method used to create an instance of a Resizer on stage at run time.

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Property Documentation

bottomMargin

public bottomMargin: Number (write)
Sets how much of the bottom of the graphic will not be stretched. Default value is 20 pixels.

Example:
attachMovie("Resizer", "panel", 0);
panel.skin = "panelSkin";
panel.topMargin = 20;
panel.bottomMargin = 20;
panel.leftMargin = 20;
panel.rightMargin = 20;
panel.setSize(500, 500);

bottomMargin

public bottomMargin: Number (read)
Gets how much of the bottom of the graphic will not be stretched.

Example:
myVar = panel.bottomMargin;

leftMargin

public leftMargin: Number (write)
Sets how much of the left hand side of the graphic will not be stretched. Default value is 20 pixels.

Example:
attachMovie("Resizer", "panel", 0);
panel.skin = "panelSkin";
panel.topMargin = 20;
panel.bottomMargin = 20;
panel.leftMargin = 20;
panel.rightMargin = 20;
panel.setSize(500, 500);

leftMargin

public leftMargin: Number (read)
Gets how much of the left hand side of the graphic will not be stretched.

Example:
myVar = panel.leftMargin;

margin

public margin: Number (write)
Sets the topMargin, bottomMargin, leftMargin and rightMargin to the same value.

Example:
attachMovie("Resizer", "panel", 0);
panel.skin = "panelSkin";
panel.margin = 20;
panel.setSize(500, 500);

margin

public margin: Number (read)
If all four margin values are equal, returns their value, otherwise returns undefined.

Example:
myVar = panel.margin;

rightMargin

public rightMargin: Number (write)
Sets how much of the right hand side of the graphic will not be stretched. Default value is 20 pixels.

Example:
attachMovie("Resizer", "panel", 0);
panel.skin = "panelSkin";
panel.topMargin = 20;
panel.bottomMargin = 20;
panel.leftMargin = 20;
panel.rightMargin = 20;
panel.setSize(500, 500);

rightMargin

public rightMargin: Number (read)
Gets how much of the right hand side of the graphic will not be stretched.

Example:
myVar = panel.rightMargin;

skin

public skin: String (write)
Sets the skin to be used in the resizer. This is a string set to the linkage name of a movie clip containing a graphic. The movie clip must be set to export.

Example:
attachMovie("Resizer", "panel", 0);
panel.skin = "panelSkin";
// "panelSkin" is the linkage name of a movie clip in the library, containing the stretchable graphic.
panel.topMargin = 20;
panel.bottomMargin = 20;
panel.leftMargin = 20;
panel.rightMargin = 20;
panel.setSize(500, 500);

skin

public skin: String (read)
Gets the skin used in the resizer.

Example:
myVar = panel.skin;

topMargin

public topMargin: Number (write)
Sets how much of the top of the graphic will not be stretched. Default value is 20 pixels.

Example:
attachMovie("Resizer", "panel", 0);
panel.skin = "panelSkin";
panel.topMargin = 20;
panel.bottomMargin = 20;
panel.leftMargin = 20;
panel.rightMargin = 20;
panel.setSize(500, 500);

topMargin

public topMargin: Number (read)
Gets how much of the top of the graphic will not be stretched.

Example:
myVar = panel.topMargin;


Constructor Documentation

Resizer

public function Resizer(Void)

Method Documentation

create

public static function create(target: MovieClip,
 id: String,
 depth: Number,
 initObj: Object): Resizer
Static method used to create an instance of a Resizer on stage at run time.

Parameters:
target
the movie clip to which the resizer will be attached.
id
the instance name given to the new resizer attached.
depth
the depth at which to attach the new resizer.
initObj
(optional) an object containing any properties you want to assign to the component when it is created
Returns:
a reference to the new resizer attached.

Example:
import com.bjc.controls.Resizer;
var newResizer:Resizer = Resizer.create(_root, "myResizer", 0);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com