MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guide de l'utilisateur Page 143

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 256
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 142
143
12
CHAPTER 12
Use an Event Listener
When you develop Adobe Flex applications, event handling is one of the most basic and
important tasks. Events let you know when something happens within a Flex application.
They can be generated by user devices such as the mouse and keyboard, or other external
input such as the return of a web service call. Events are also triggered when changes happen
in the appearance or life cycle of a component, such as the creation or destruction of a
component or when the component is resized.
You can respond to these events in your code by using event listeners. Event listeners are
functions or class methods that you write to respond to specific events. Theyre also known as
event handlers.
This lesson shows you how to use an event listener. You’ll learn how to write one for a Button
control, and then how to associate the listener with the Buttons click event by using two
different methods.
In this lesson, you’ll complete the following tasks:
Set up your project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Create a simple user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Write an event listener. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Associate the listener with an event with MXML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Associate the listener with an event with ActionScript . . . . . . . . . . . . . . . . . . . . . . . 148
Vue de la page 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 255 256

Commentaires sur ces manuels

Pas de commentaire