Loading and Initializing Flex Applications
When you load a Flex application and run it, it may appear that not much is going on. As a user, you typically see a progress indicator until the application has loaded and initialized. However, behind the scenes an intricate process kicks off and runs its course until the application is ready to display to the user. As a Flex developer, you don’t often have to concern yourself with exactly what is happening behind the scenes, but this knowledge can help you to better understand how to build an application and how to diagnose problems.
As we mentioned earlier in this chapter, Flex applications are .swf files that run in Flash Player. Historically, Flash Player was created to play back vector animations. Therefore, although the capabilities of Flash Player have grown tremendously since its earliest stages, its historical roots remain, and Flash Player still uses a timeline metaphor when running .swf content. Flash Player supports the concept of frames—much like frames of a movie. These frames occur sequentially over time, and unless otherwise instructed, Flash Player will automatically play back the frames of an .swf file as they are available because the .swf format is a progressive download format. That means Flash Player doesn’t need to wait for an entire .swf file to download before it can begin to read the .swf content and play it back or run it. As we’ll see in just a moment, the Flex framework uses this fact to its advantage. Each ...
Get Programming Flex 3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.