浏览 1552 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2011-10-25
http://forums.adobe.com/message/2536270
from:<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <s:layout> <s:HorizontalLayout /> </s:layout> <fx:Script> <![CDATA[ private function cloneButton_clickHandler (event:MouseEvent):void { var childDescriptors:Array = original.childDescriptors; var descriptorsCount:int = childDescriptors.length; for (var i:int; i < descriptorsCount; i++) { cloned.createComponentFromDescriptor(original.childDescriptors[i], false); } cloned.validateNow(); } ]]> </fx:Script> <mx:Button label="Clone Canvas" click="cloneButton_clickHandler(event);" /> <mx:Canvas id="original" width="100" height="100" borderStyle="solid" > <mx:Label text="Some Label" /> <mx:ComboBox dataProvider="{['data1', 'data2']}" bottom="0" /> </mx:Canvas> <mx:Canvas id="cloned" width="100" height="100" borderStyle="solid" > </mx:Canvas> </s:Application> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |