Translated from: http://www.uza.lt/codex/as3-scale9-bitmap/
Brief introduction:
AS3 Scale9 Bitmap is an auxiliary class that can be used to create nine lattice sprite by bitmap data padding, which is not possible in Flash 9. This helper class creates 9 virtual nine lattice sprite based on the user-defined scaling matrix. Particularly useful for creating user interfaces (such as buttons, scalable UI elements, and so on).
Content:
Scale9simplestatebutton-Class for creating a button with a scalable 1, 3, or 3 state that uses bitmap data (skin).
Scale9simplebitmapsprite-A class of sprite used to create static, scalable UI elements using bitmap data (skins).
Sample code (Flex Builder 3 project)
Requirements:
ActionScript3
Scale9simplestatebutton (upper left), Scale9simplebitmapsprite (lower right) and initial skin file (bottom)
Sample syntax:
Actionscript:
var scale9_example:rectangle = new Rectangle (6,6,105,20);
/* Initialize the button with all 3 states (normal, hover, down) using 3 different bitmaps */
var Button_example:scale9simplestatebutton = new Scale9simplestatebutton (
Scale9_example,
Button_skin_normal.bitmapdata,
Button_skin_hover.bitmapdata,
button_skin_ Down.bitmapdata
);
/*
* Scale the button using "width" and "ScaleY" Properties
* (in general you can use "width", "height", "scale Y "," ScaleX "Properties for scaling)
*/
button_example.width = +;
Button_example.scaley = 2;
Download:
Http://www.uza.lt/download/2