MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 649

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

// all of these borders have the same size edges, one pixel
var offset:Number = 1;
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 ourselves 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 package myTheme, change the class declaration as needed.
Save the AS file.
4.
Create a new FLA file.
5.
Use Insert > New Symbol to create a new movie clip symbol.
6.
Set the name to
7.
RectBorder
If the advanced fields are not displayed, click Advanced.
8.
Select Export for ActionScript
9.
The identifier will be automatically filled in as
Set the AS 2.0 class to the full class name of the custom border implementation.
10.
This example uses mx.skins.myTheme.RectBorder.
Ensure that Export in First Frame is selected, and click OK.
11.
Open the RectBorder symbol for editing.
12.
Draw the graphics for the symbol.
13.
For example, draw a hairline square with no fill. To make the custom border easy to see, set the
line color to bright red.
.
RectBorder
.
RectBorder class
649

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents