MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Bedienungsanleitung Seite 26

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 36
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 25
Version#1.0#(May#14,#2009)#
Now!that!we!have!an!instance!of!our!Application!class!created,!the!SystemManager!
registers!to!the!instance’s!FlexEvent.CREATION_COMPLETE!event,!defines!the!url!and!
the!parameters!on!the!Application!instance!and!then!updates!the!width!and!height!
of!both!the!Application!and!the!SystemManager.!
29
!!!
After!the!size!has!been!updated!on!the!Application,!the!SystemManager!registers!
the!Application!instance!with!the!Preloader.!The!registration!of!the!Application!
to!the!Preloader,!enables!the!Preloader!to!register!to!the!different!Lifecycle!
validation!events!(“validatePropertiesComplete”,!“validateSizeComplete”,!
CREATION_COMPLETE,!etc.).!!By!registering!to!these!events!the!Preloader!can!provide!
the!user!more!feedback!as!the!Application’s!Component!Growth!Phases!progress.!
Flex+Application+Ph a s e:+Child+Display+
Since!our!Application!Class!extends!UIComponent!it!must!follow!the!Component!
Lifecycle.!!At!this!point,!the!Application!has!now!completed!its!Construction!phase!
but!will!not!begin!the!Addition!Phase!until!it!is!added!to!its!parent,!the!
SystemManager.!
If!the!SystemManager!was!to!just!call!addChild()!now!and!go!through!the!three!child!
addition!steps!(addingChild(),!$addChild()!and!childAdded())!the!Flash!Player!
would!begin!rendering!the!Application!content!to!screen.!!Yet,!the!process!of!
creating!all!the!Application’s!children!and!running!all!the!potential!initialization!
code!required!to!get!the!Application!finalized!takes!a!lot!of!time!and!frame!cycles.!!!
Much!of!this!labor!would!require!screen!re‐draws!that!may!or!may!not!be!
meaningful!until!the!Application!has!completed!its!Initialization!Phase!and!first!
Invalidation‐Validation!Cycle.!!To!prevent!this!unnecessary!re‐drawing!the!
SystemManager only!calls!addingChild()!and!childAdded()!to!start!the!birth!and!
growth!phases!of!the!children!components.!!!
After!the!Application!dispatches!the!CREATION_COMPLETE!event
30
!the!SystemManger!
sends!the!Application!through!one!more!invalidation!pass.!!The!Preloader!is!also!
listening!to!the!Application’s!CREATION_COMPLETE!which!dispatches!a!
PRELOADER_DONE!event!to!the!SystemManager.!
The!SystemManager!removes!the!Preloader!at!this!point,!since!it!has!completed!its!
UI!task.!Once!the!Preloader!is!removed!the!SystemManager!adds!the!Application!
instance!using!super.addChild()!and!then!both!has!the!Application!and!itself!
dispatch!the!FlexEvent.APPLICATION_COMPLETE!event.!
Now!that!the!Application!is!up!and!running!the!SystemManager!relegates!itself!back!
to!tracking!system!mouse!events,!focus!management,!dialog!management!and!other!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29
#The#reason#that#t he#SystemManager’s# width#and# height#are#also#updated#is #that #between#initial#
creation#and# now,#the#user#may#have#resized#the#application#window.##If#you#re call,#the#
SystemManager#just#registered#to# the#RESIZE#event#of#the#stage,#so#previous#resizes#m ay#have#been#
missed.#
30
#Thi s#event#means#the#Applicatio n#has#progressed#through#its#entire#bi rth#and#g rowth#lifecycle.#
Seitenansicht 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 35 36

Kommentare zu diesen Handbüchern

Keine Kommentare