MACROMEDIA FLEX-GETTING STARTED WITH FLEX Uživatelský manuál Strana 66

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 148
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 65
Controls
So many controls are available for you to use with Flex that it’s
almost hard to know where to begin. I suppose the best place
to start is with the basic controls, such as labels, buttons,
checkboxes, and so on. Example 4-10 shows an MXML appli-
cation that provides a heaping helping of the basic control
types.
Example 4-10. Buttons2.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="horizontal">
<mx:VBox horizontalAlign="left">
<mx:Label text="Text label" />
<mx:Label htmlText="&lt;b&gt;HTML&lt;/b&gt; text" />
<mx:Button label="Button" />
<mx:CheckBox label="Check box" />
<mx:RadioButtonGroup id="cardType"/>
<mx:RadioButton label="Visa" groupName="cardType" />
<mx:RadioButton label="MasterCard" groupName="cardType"/>
<mx:ComboBox dataProvider="{['a','b','c']}" />
<mx:HSlider />
<mx:TextInput />
</mx:VBox>
<mx:VBox horizontalAlign="left">
<mx:List dataProvider="{['a','b','c']}" width="200"
height="100" />
<mx:ButtonBar dataProvider="{['a','b','c']}" />
<mx:NumericStepper />
<mx:Image source="@Embed('megan.jpg')" />
</mx:VBox>
</mx:Application>
When I run this in Flex Builder I see Figure 4-10.
As you would expect, in addition to these controls, you also
have available labels with flat text and HTML, push buttons,
checkboxes and radio boxes, combos, text inputs, and lists, as
well as some cool new controls such as sliders, numeric step-
pers, button bars, and images, among others.
50 | Chapter 4:Flex Controls and Layout
Zobrazit stránku 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 147 148

Komentáře k této Příručce

Žádné komentáře