MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guida Utente Pagina 152

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 256
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 151
152 Use Behaviors
Create a behavior
You decide to create a behavior so that a button glows when a user clicks it. You want the glow
to be green, last one and a half seconds, and leave the button a pale green to indicate it was
clicked.
1. With your Lessons project selected in the Navigator view, select File > New > MXML
Application and create an application file called Behaviors.mxml.
2. Designate the Behaviors.mxml file as the default file to be compiled by right-clicking
(Control-click on Macintosh) the file in the Navigator view and selecting Set As Default
Application from the context menu.
3. In the MXML editor’s Source mode, define a Glow effect by entering the following tag
after the opening
<mx:Application> tag:
<mx:Glow id="buttonGlow" color="0x99FF66" alphaFrom="1.0" alphaTo="0.3"
duration="1500"/>
The Glow effect starts fully opaque and gradually becomes more transparent, but not fully
transparent. A pale glow persists after the effect has played to indicate that the button was
clicked.
4. In Design mode, drag a Panel container into the layout from the Layout category of the
Components view, and then set the following Panel properties in the Properties view:
Width: 200
Height: 300
X: 10
Y: 10
5. Drag a Button control into the Panel from the Controls category of the Components view,
and then set the following Button properties in the Properties view:
ID: myButton
Label: View
X: 40
Y: 60
NOTE
For the purpose of these lessons, several application files are used in a single Flex
Builder project. However, it’s good practice to have only one MXML application file
per project.
Vedere la pagina 151
1 2 ... 147 148 149 150 151 152 153 154 155 156 157 ... 255 256

Commenti su questo manuale

Nessun commento