MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual de usuario Pagina 162

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 184
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 161
162 Customizing Components
Specifying the package
Define your custom components within an ActionScript package. The package reflects the
directory location of your component within the directory structure of your application.
package myComponents
{
// Class definition goes here.
}
Defining the class
The class definition must be prefixed by the public keyword, as the following example shows:
// Class definition goes here.
public class MyButton extends Button {
// Define properties, constructor, and methods.
}
Defining the constructor
If the class is missing a constructor, add it. A constructor for a child class of UIComponent
must have no required arguments; it can only have optional ones.
Here is a typical constructor:
public function Button() {
super();
className = "Button";
btnOffset = 0;
}
Creating bindable properties
In Flex 1.5, you use the [ChangeEvent] metadata tag to define a property as bindable. In Flex
2.0, you use the
[Bindable] metadata tag. For more information, see Creating and Extending
Flex 2 Components.
Vista de pagina 161
1 2 ... 157 158 159 160 161 162 163 164 165 166 167 ... 183 184

Comentarios a estos manuales

Sin comentarios