Defining variables

The following code sample is from Button.as file (mx.controls.Button). It defines a variable, btnOffset, to use in the class file. It also defines the variables __label, and __labelPlacement. 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 Using getter/setter methods to define parameters in Learning ActionScript 2.0 in Adobe 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 = "default value";

/**
*@private
* default label placement
*/
    var __labelPlacement:String = "right";

Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002494.html