Version#1.0#(May#14,#2009)#
means!that!Flex!is!bound!to!the!same!set!of!rules!and!realities!of!any!Flash!SWF.!!The!
one!fundamental!rule!that!all!SWF!files!must!conform!to!is!that!Flash!is!frame‐based.!
For!those!unfamiliar!with!the!history!of!Flash,!the!initial!goal!of!the!player!was!to!
create!animation.!!Traditional!animation!is!cell!based,!you!draw!an!image!on!the!cell!
replace!it!with!a!new!cell!that!has!a!slightly!modified!image!and!at!a!certain!speed!
the!changes!look!like!motion.!So,!in!place!of!cells,!Flash!uses!frames!to!create!the!
same!effect!for!animations.!!Frames!still!exist!and!in!fact!all!logic!and!screen!
rendering!is!bound!to!the!frame!change!and!the!defined!frame!rate.!
The!frame!rate!tells!Flash!how!many!frames!per!second!it!should!try!to!process;!by!
default!Flex!is!set!to!24!frames!per!second.!!This!number!does!not!guarantee!that!
Flash!will!execute!24!frames!per!second!but!it!does!guarantee!that!it!won’t!do!more!
then!24!frames!per!second.!!The!real‐time!frame!rate!(how!many!frames!per!second!
Flash!actually!executes)!is!dependent!on!many!different!things,!a!few!being:!!the!
complexity!of!code!being!executed,!the!amount!of!content!that!has!changed!causing!
it!to!be!re‐rendered!on!screen,!and!of!course!the!performance!ability!of!the!machine!
hosting!the!Flash!Player.!
The+Elastic+Racetrack+
Ted!Patrick!wrote!an!excellent!post!about!the!Flash!frame!execution!order!and!what!
he!has!dubbed!“The!Elastic!Racetrack”
2
.!!It!is!an!older!article,!targeted!at!Flash!
Player!7,!but!what!he!talks!about!is!fundamentally!true!today!with!Flash!Player!10.!!!
The!main!aspect!to!take!away!from!his!post!is!that!the!Flash!frame!is!split!into!two!
phases:!!the!code!execution!phase!and!the!screen!re‐draw/render!phase.!!The!code!
execution!is!a!linear,!non‐threaded!pass!that!has!to!execute!all!code!requested!for!
the!current!frame.!!During!this!pass,!data!is!processed,!calculations!are!made!and!
any!modifications!to!the!Display!List!(DOM)!are!applied.!Once!all!the!code!has!been!
executed,!and!the!display!list!has!been!updated,!then!the!Flash!Player!renders!the!
changes!to!the!screen.!
With!the!release!of!Flash!Player!9!and!ActionScript!3,!the!player!team!created!a!new!
ActionScript!Virtual!Machine!(AVM2)!to!support!the!new!language!and!feature!set.!!
They!also!re‐designed!the!Flash!DOM!to!support!easier!development!within!the!new!
player.!!Sean!Christmann,!from!EffectiveUI,!took!Ted!Patrick’s!Elastic!Racetrack!
concept!and!updated!it!to!reflect!the!changes!in!the!new!virtual!machine
3
.!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2
#Read#Te d#Patrick’ s#pos t#at:#
#http://www.onflex.org/ted/2005/07/flash^player^mental^model^elastic.php#
#
3
#Read#Sean#Christmann’s#update#to#t he#Elastic #Racetrac k#at:#
http://www.craftymind.com/2008/0 4/18/updated^elastic^racet rack^for^flash^9^and^av m2/#
#
#
Komentarze do niniejszej Instrukcji