MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual de usuario Pagina 9

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 36
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 8
UNDERSTANDING+THE+FLEX+3+COMPONENT+AND+FRAMEWORK+LIFECYCLE!
9!
!
©!2009!DevelopmentArc!LLC,!All!rights!reserved.!
!
Figure'1')' The'Phases'of'the'Component'Lifecycle'
These!are!not!the!official!Adobe!terms,!but!we!have!organized!the!stages!into!
categories!to!help!define!what!the!component!is!doing!and!when.!Our!seven!stages!
correspond!to!the!four!life!stages!as!follows.!!The!Birth!stage!is!made!up!of!
Construction,!Addition,!and!Initialization.!!The!growth!and!maturity!phase!are!made!
up!of!Invalidation,!Validation!and!Update.!!The!death!state!is!defined!by!the!Removal!
phase.!!Let’s!look!at!the!first!phase:!Construction.!
Component+Phases:+Construction+(birth)+
The!Construction!phase!is!the!very!first!phase!of!a!component!and!is!defined!when!
we!call!the!Component’s!constructor.!!The!Adobe!Flex!documentation!uses!Button!
as!their!example!component,!so!let’s!follow!in!their!footsteps.!
var myButton:Button = new Button(); // this is our construction phase
Pretty!obvious,!right?!!What!isn’t!obvious!about!this!phase!is!that!very!little!actually!
happens.!!So!what!does!happen!during!the!Construction!phase?!!
If!we!start!at!the!Button’s!constructor!and!walk!up!the!super()!chain,!we!first!go!to!
UIComponent,!then!to!FlexSprite,!then!to!Sprite!(where!we!can!no!longer!see!the!
source!code!since!its!part!of!playerglobal.swc).!!FlexSprite!is!high!enough!up!the!
inheritance!chain!to!get!a!good!overall!picture!of!the!construction!process,!so!we!
will!start!there!for!this!example.!!!
Vista de pagina 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 35 36

Comentarios a estos manuales

Sin comentarios