MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1072

Components language reference
Table of Contents

Advertisement

To create a custom RectBorder implementation:
1.
Create a new folder in the Classes/mx/skins folder corresponding to the custom package
name that you will use for the custom border.
For this example, use
2.
Create a new AS file in the new folder and save it as RectBorder.as.
3.
Copy the following ActionScript code to the new AS file:
import mx.core.ext.UIObjectExtensions;
class mx.skins.myTheme.RectBorder extends mx.skins.RectBorder
{
static var symbolName:String = "RectBorder";
static var symbolOwner:Object = RectBorder;
var className:String = "RectBorder";
#include "../../core/ComponentVersion.as"
// All of these borders have the same size edges, 1 pixel.
var offset:Number = 4;
function init(Void):Void
{
super.init();
}
function drawBorder(Void):Void
{
// The graphics are on the symbol's timeline,
// so all you need to do here is size the border.
_width = __width;
_height = __height;
}
// Register the class as the RectBorder for all components to use.
static function classConstruct():Boolean
{
UIObjectExtensions.Extensions();
_global.styles.rectBorderClass = RectBorder;
_global.skinRegistry["RectBorder"] = true;
return true;
}
static var classConstructed:Boolean = classConstruct();
static var UIObjectExtensionsDependency = UIObjectExtensions;
}
If you're not using the
4.
Save the AS file.
1068
RectBorder class
.
myTheme
package, change the class declaration as needed.
myTheme

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents