User Guide

Improving application start-up time and performance 67
Controlling application appearance
Flex defines a default “look and feel” (appearance) that you can use as-is in an application, or
modify to define your own specific appearance. As part of modifying the appearance, you can
change some or all of the following:
Styles Set of characteristics, such as font, font size, text alignment, and color. These are the
same styles as defined and used with Cascading Style Sheets (CSS). For more information, see
Chapter 20, “Using Styles and Fonts,” in Developing Flex Applications.
Skins Symbols that control a component’s appearance. For more information, see Chapter 20,
“Using themes and skins,” in Developing Flex Applications.
Behaviors Visible or audible changes to a Flex component triggered by an application or user
action. Examples of behaviors are moving or resizing a component based on a mouse click. For
more information, see Chapter 21, “Using Behaviors,” in Developing Flex Applications.
Sizes Height and width of a component or application. All components have a default size.
You can use the default size, specify your own size, or let Flex resize a component as part of laying
out your application. For more information, see Chapter 4, “Introducing Containers,” in
Developing Flex Applications.
Enabling application zooming in Flash Player
By default, the zoom feature of Flash Player is disabled for Flex applications. You can enable
zooming for individual applications using a function like the one in the following example. Write
the function in an
<mx:Script> tag, and specify it as the event handler for the initialize event
of the
<mx:Application> tag.
<mx:Application width="600" height="400"
xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="initMyApp();">
<mx:Script>
<![CDATA[
function initMyApp(){
var myMenu=new ContextMenu();
myMenu.builtInItems.zoom = true;
document.menu=myMenu;
}
]]>
</mx:Script>
...
</mx:Application>
Improving application start-up time and performance
This section describes some very simple things that you can take to improve application start-up
time. For more information, see Chapter 27, “Improving Layout Performance,” in Developing
Flex Applications.
During the Flex product life cycle, Macromedia will provide additional information about
performance on the Macromedia website (see www.macromedia.com/go/flex).