積少成多Flash(9)

來源:互聯網
上載者:User

介紹

示範 Flex 3.0 中的布局控制項的應用,樣式和皮膚的應用

布局控制項 - Flex 中常用的布局控制項一覽

樣式 - 通過 css 控制 Flex 中各個控制項的樣 式

皮膚 - 使用 Flash 開發的 swf 做控制項的皮膚

線上DEMO

http://www.cnblogs.com/webabcd/archive/2009/11/09/1598980.html

1、布局控制項一覽

Layout.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
title="Layout 常用布局控制項一覽" width="476" height="427">

<mx:Script>
<![CDATA[

import mx.controls.Alert;

private function submitForm(e:MouseEvent):void
{
Alert.show("Item1: " + item1.text, "Alert框");
}

]]>
</mx:Script>

<!--
HBox - 水平線性布局
VBox - 垂直線性布局
-->
<mx:HBox x="10" y="10" width="438" horizontalGap="50" borderThickness="1" borderStyle="solid">
<mx:Label text="HBox - Label1"/>
<mx:Label text="HBox - Label2"/>
</mx:HBox>

<!--
HDividedBox - 在 HBox 的基礎上,以垂直方向顯示分隔條
VDividedBox - 在 VBox 的基礎上,以水平方向顯示分隔條
-->
<mx:HDividedBox x="10" y="36" width="438" borderThickness="1" borderStyle="solid">
<mx:Label text="HDividedBox - Label1"/>
<mx:Label text="HDividedBox - Label2"/>
</mx:HDividedBox>

<!--
Panel - 面板。可設定其標題,內容等
-->
<mx:Panel width="171" height="97" layout="absolute" title="Panel - Title" x="10" y="64" borderThickness="1" borderStyle="solid">
<mx:Label text="Panel - Label1"/>
</mx:Panel>

<!--
Grid - 網格型布局控制項
-->
<mx:Grid x="10" y="169" borderThickness="1" borderStyle="solid">
<mx:GridRow width="100%" height="100%">
<mx:GridItem width="100%" height="100%">
<mx:Label text="Grid - Label1"/>
</mx:GridItem>
<mx:GridItem width="100%" height="100%">
<mx:Label text="Grid - Label2"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="100%">
<mx:GridItem width="100%" height="100%" colSpan="2" horizontalAlign="center">
<mx:Label text="Grid - Label3"/>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>

<!--
Form - 用於構建表單型布局
-->
<mx:Form x="189" y="64" width="259" height="149" borderThickness="1" borderStyle="solid">
<mx:FormHeading label="Form - Head"/>
<mx:FormItem label="Item1: ">
<mx:TextInput id="item1" />
</mx:FormItem>
<mx:FormItem>
<mx:HRule height="1" width="100%" />
<mx:Button label="Form - Submit" click="submitForm(event)" />
</mx:FormItem>
</mx:Form>

<!--
Canvas - 絕對位置布局控制項
-->
<mx:Canvas width="438" height="84" x="10" y="221" borderThickness="1" borderStyle="solid">
<mx:Label text="Canvas - Label1"/>
<mx:Label text="Canvas - Label2" x="104" y="10"/>
<mx:Label text="Canvas - Label3" x="208" y="20"/>
</mx:Canvas>

<!--
ApplicationControlBar - 顯示為一個條形控制項
-->
<mx:ApplicationControlBar x="10" y="313" width="436">
<mx:Label text="ApplicationControlBar - Label1"/>
</mx:ApplicationControlBar>

<!--
ControlBar - Panel 底部的條形控制項
Spacer - 不用於顯示,純粹佔位用
-->
<mx:ControlBar>
<mx:Label text="Panel - ControlBar - Label1"/>
<mx:Spacer width="100%" x="154" y="350"/>
<mx:Label text="Panel - ControlBar - Label2"/>
</mx:ControlBar>
</mx:Panel>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.