MACROMEDIA FLEX-GETTING STARTED WITH FLEX Getting Started page 33

Table of Contents

Advertisement

The following figure shows the application rendered in a web browser window:
For more information about using Cascading Style Sheets, see Chapter 20, "Using Styles and
Fonts," in Developing Flex Applications.
Using effects
An effect is a change to a component that occurs over a brief period of time. Examples of effects
are fading, resizing, and moving a component. An effect is combined with a trigger, such as a
mouse click on a component, a component getting focus, or a component becoming visible, to
form a behavior. In MXML, you apply effects as properties of a control or container. Flex provides
a set of built-in effects with default properties.
The following example shows an application that contains a Button control with its
mouseOverEffect
user moves the mouse pointer over the Button control.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Panel title="My Application" marginTop="10" marginBottom="10"
marginLeft="10" marginRight="10" >
<mx:Button id="myButton" mouseOverEffect="Zoom" />
</mx:Panel>
</mx:Application>
You can use the
composite effect. For more information about effects, see Chapter 21, "Using Behaviors," in
Developing Flex Applications.
Using MXML components
MXML components are MXML files that you use as custom tags in other MXML files. They
encapsulate and extend the functionality of existing Flex components. Just like MXML
application files, MXML component files can contain a mix of MXML tags and ActionScript
code. The name of the MXML file becomes the class name with which you refer to the
component in another MXML file.
Note: You cannot access MXML component URLs directly in a web browser.
The following example shows a custom ComboBox control that is prepopulated with list items:
<?xml version="1.0"?>
<!-- MyComboBox.mxml -->
<mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:ComboBox >
property set to the standard Zoom effect. The Zoom effect executes when the
tag to customize a standard effect or combine effects into a
<mx:Effect>
About MXML
33

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-GETTING STARTED WITH FLEX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flex

Table of Contents