MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual do Utilizador Página 162

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 184
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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 página 161
1 2 ... 157 158 159 160 161 162 163 164 165 166 167 ... 183 184

Comentários a estes Manuais

Sem comentários