The following table describes these variables:
Variable
symbolName
symbolOwner
className
The following example adds the
MyButton class:
class MyButton extends mx.controls.Button {
static var symbolName:String = "MyButton";
static var symbolOwner = myPackage.MyButton;
var className:String = "MyButton";
}
Defining variables
The following code sample is from Button.as file (mx.controls.Button). It defines a variable,
, to use in the class file. It also defines the variables
btnOffset
The latter two variables are prefixed with a double underscore to prevent name conflicts when
they are used in getter/setter methods and ultimately used as properties and parameters in the
component. For more information, see
on page
935. See also "Implicit getter/setter methods" in Using ActionScript in Flash.
/**
* Number used to offset the label and/or icon when button is pressed.
*/
var
btnOffset:Number = 0;
*@private
* Text that appears in the label if no value is specified.
*/
var __label:String
/**
*@private
* default label placement
*/
var __labelPlacement:String
934
Chapter 7: Creating Components
Type
Description
String
The name of the ActionScript class (for example, ComboBox).
This name must match the symbol's Linkage Identifier.
This variable must be static.
Object
The fully qualified class name (for example, mypackage.MyComponent).
Do not use quotation marks around the
an Object data type.
This name must match the AS 2.0 class in the Linkage Properties dialog
box.
This variable is used in the internal call to the
method.
This variable must be static.
String
The name of the component class. This does not include the package
name and has no corresponding setting in the Flash development
environment.
You can use the value of this variable when setting style properties.
symbolName
= "default value";
,
, and
symbolOwner
"Using getter/setter methods to define parameters"
= "right";
value, because is is
symbolOwner
createClassObject()
variables to the
className
, and
__label
__labelPlacement
.
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