MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Instrukcja Użytkownika Strona 18

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 36
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 17
Version#1.0#(May#14,#2009)#
initialized!or!not,!if!not!the!LayoutManager!marks!the!component!initialized.!!At!this!
point!our!component!is!considered!initialized!and!updated.!!The!LayoutManager!
then!has!the!component!dispatch!the!FlexEvent.UPDATE_COMPLETE!event.!
Component+Phases:+Update+(maturity)+
The!update!phase!is!defined!as!any!time!a!component!is!invalidated!and!then!goes!
through!the!validation!cycle.!!Once!the!component!is!validated!the!LayoutManager!
will!once!again!make!the!component!dispatch!the!UPDATE_COMPLETE!event
18
.!!This!
cycle!repeats!itself!over!and!over!until!the!component!is!removed!from!its!parent.!!
Its!important!to!note!that!the!Update!phase!is!where!a!component!spends!the!most!
time!during!its!lifecycle.!!As!the!application!is!being!interacted!with!by!the!user!the!
components!are!constantly!being!Updated!and!changed.!!For!more!details!about!
how!to!manage!the!Update!phase!refer!to!the!Validation!Cycle!and!Methods!section!
below.!
Component+Phases:+Removal+(death)+
The!last!phase!of!a!component!is!the!removal!phase.!!This!phase!occurs!when!the!
component!is!no!longer!parented.!!In!most!cases,!this!occurs!when!removeChild()!is!
called!on!the!parent!component,!passing!in!the!component!to!remove!as!a!reference.!!
The!reason!we!say!“most!cases”!is!because!when!the!parent!of!the!component,!or!
further!up!the!parent!hierarchy,!is!removed!from!the!display!stack!the!component!
may!enter!the!Removal!phase,!depending!upon!how!the!components!are!referenced!
in!the!application.!!We!explain!more!about!this!in!a!bit.!
When!removeChild()!is!applied!to!a!child,!such!as:!
this.removeChild(myButton);
Figure'8')' Remo ve'Child'Example'
The!parent!component’s!removeChild()!method!calls!three!methods,!just!like!
addChild().
19
!!The!first!method!called!is!removingChild()!which!by!default!(at!the!
UIComponent!level)!does!nothing.!!This!can!be!overridden!to!perform!functionality!
before!the!component!is!removed!from!the!display!stack.!!!
The!next!method!called!is!$removeChild()!which!is!a!Flash!Player!level!method!that!
does!the!actual!removal!of!the!component!from!the!display!stack!and!then!checks!
the!components!references!in!memory.!!If!there!are!no!references!to!the!component!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
best#practices#on#utilizing#each#of#the#validation#methods#in#custom#components#see#the#Validation!
Cycle!and!Methods#section#below.!
18
#The#LayoutManager#also#dispatch es#an#UPDATE_COMPLETE#event#when#all#of# the#registered#
components#have#completed#their#Va lidation#phase.#
19
#Its# important#to#note#that#our#references#to#functi onality,#such#a s#removeChild()#are#defi ned#at#
the# UIComponent#level.##It’s #quit e#possible#that #over ridin g#these#methods#later#down#the#inheritanc e#
stack#can#change#the#defined#functionality,#order,#e tc.##It’s#not#recommended#to#mak e#such#radical#
changes,#but# it#may#occur#if#deemed#appropriate.#
Przeglądanie stron 17
1 2 ... 13 14 15 16 17 18 19 20 21 22 23 ... 35 36

Komentarze do niniejszej Instrukcji

Brak uwag