MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Bedienungsanleitung Seite 24

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 36
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 23
Version#1.0#(May#14,#2009)#
external!content!is!delegated!to!the!SystemManager,!which!uses!a!Preloader!to!load!
the!content!in!and!display!feedback!to!the!user!as!it!loads.!
Once!the!SystemManager!creates!the!Preloader,!it!registers!to!the!Preloader’s!
FlexEvent.INIT_PROGRESS and!FlexEvent.PRELOADER_DONE!events!so!that!the!
SystemManager!can!begin!the!Application!Class!Construction‐Initialization!phase!
once!all!of!the!required!external!data!has!been!loaded.!The!Preloader!instance!is!
then!added!as!a!child
26
!of!the!SystemManager,!but!the!data!loading!is!not!begun!yet.!!!
The!SystemManager!first!needs!to!build!a!list!of!required!external!assets!before!the!
Preloader!can!begin!loading!content.!The!first!list!of!external!content!defined!for!
the!Preloader!is!the!list!of!RSLs!required!for!the!application.!
27
!!The!list!of!RSLs!is!
provided!by!using!the!info()!method
28
!which!is!populated!by!compiler!magic.!
Once!the!list!of!RSLs!has!been!defined,!the!SystemManager!creates!an!instance!of!the!
ResourceManager!enabling!the!Preloader!to!have!access!to!the!compiled!resource!
bundle.!!A!default!Resource!Bundle!is!always!compiled!into!the!application!so!that!
the!Preloader!can!display!localized!text!to!the!user!or!if!the!system!runs!into!any!
errors,!the!errors!may!be!displayed!to!the!user!in!their!language.!!If!the!system!did!
not!have!the!resource!bundle!compiled!in!at!this!time,!it!would!not!be!possible!to!
show!the!user!localized!text!since!the!Preloader!has!not!yet!loaded!the!external!
bundles.!
The!SystemManager!sets!up!the!base!StyleManager!so!that!the!Preloader!can!use!it!
and!then!the!SystemManager!parses!any!locale!chains!set!via!the!flash!vars!on!the!
SWF!to!determine!which!locale!to!use!for!the!application.!Next,!the!SystemManger!
builds!a!list!of!external!resource!bundles!to!load!via!their!defined!URLs!in!the!flash!
vars,!determines!if!a!custom!display!class!has!been!defined!for!the!Preloader!(more!
compiler!magic!via!info())!and!then!kicks!off!the!Preloader!passing!in!the!list!of!
external!assets!(RSLs,!resource!bundles)!to!load!and!the!display!class!used!to!render!
the!Preloader.!
Flex+Application+Ph a s es:+Preloading+
The!Preloader takes!the!external!assets!lists!(RSLs,!SWZ,!Resource!Bundles),!
creates!an!instance!of!the!RSLListLoader and!begins!loading!in!the!content.!!As!the!
RSLs!and!Resource!Bundles!are!loaded,!progress!events!are!dispatched!to!the!UI!to!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
#By#adding#the#Preloader as#a#child#of# the#SystemManager,# this#begins#the#Preloader’s#
Component#Lifecycle.#
27
#Thi s#list#of#RSLs#will#in clude#the#Flex# Framework#library#(SW Z)#if#the#developer#has#e nabled#this#at#
compile#time.#
28
#The#info()#method#is#an#inte resting#beast.##If#you#look#at# the#code#i n#the#SystemManager#you#will #
see#that# info()#just# returns#{}.## Yet,#the#code#consistently#makes#references#such#as#
info()[“rsls”]#whi ch#should #not#return#a#value #according#to#the#default#code.##We#have#not#
confirmed#this#with#the#development#team#(or#by#resear ching#the#com piler)#but#we#believe#the #compiler#
overrides#the#info()#method#during#compilation#to#p rovide#val ues/settings#required#by#the#
applicati on.##This#f eature#en ables#dynamic#settings#to#be#available#to#the#application#with out#havin g#to#
access#an#external#source.#
Seitenansicht 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 ... 35 36

Kommentare zu diesen Handbüchern

Keine Kommentare