当前位置: 代码迷 >> Web前端 >> outerDocument的应用
  详细解决方案

outerDocument的应用

热度:79   发布时间:2012-11-08 08:48:11.0
outerDocument的使用
      在Flex中,有时会用到标签<mx:component>,该标签定义了一个新的域。在该域内的变量名可以和域外定义的变量重名,并且只能在该域内使用。这时,如果你想调用域外的变量,则需要使用outerDocument。例如:
<mx:Accordion id="accordion" backgroundAlpha="0.0" headerStyleName="accHeader" historyManagementEnabled="true" height="100%" width="100%" headerHeight="32" borderStyle="none">
        <mx:headerRenderer>
            <mx:Component>
                <mx:Button fontWeight="normal" labelPlacement="right" textAlign="left" cornerRadius="{outerDocument.accordion.getStyle('headerHeight')/2}" />
            </mx:Component>
        </mx:headerRenderer>
<mx:/Accordion>

outerDocument.accordion.getStyle('headerHeight')/2中使用了accordion中的headerHeight。
该例子给accordion创建了一个简单按钮作为头部。
  相关解决方案