MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 86

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 124
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 85
TUTORIALS POINT
Simply Easy Learning Page 81
Flex Event Handling
This chapter describes the usage of Event Handling:
F
lex uses concept of event to pass data from one object to another depend upon the state or user
interaction within the application.
ActionScript has a generic Event class which defines much of the functionality needed to work with events. Every
time an event occurs within a Flex application, three types of objects from the Event class hiearchy are created.
Event has the following three key properties
Property
Description
type
type states about what kind of event just happened. This may be click, initialize, mouseover,
change, etc. The actual values will be represented by constants like MouseEvent.CLICK.
target
The target property of Event is an object reference to the component that generated the
event.If you click a Button with an id of clickMeButton, the target of that click event will be
clickMeButton
currentTarget
The currentTarget property varies container hiearchy. It mainly deals with flow of events.
Event Flow Phases
An event goes through three phases looking for event handlers.
Phase
Description
Capture
In the capture phase the program will start looking for event handlers from the outside (or top)
parent to the innermost one. The capture phase stops at the parent of the object that triggered the
event.
Target
In the target phase ,the component that triggered the event, is checked for an event handler.
Bubble
The Bubble phase is reverse of capture phase, working back through the structure, from the target
component's parent on up.
CHAPTER
15
Vedere la pagina 85
1 2 ... 81 82 83 84 85 86 87 88 89 90 91 ... 123 124

Commenti su questo manuale

Nessun commento