开发者

deep copy or clone of a UIComponent

I tried this:

registerClassAlias("mx.core.UIComponent",UIComponent);
var ob:UIComponent= UIComponent(ObjectUtil.copy(flexUI));//where flexUI is source UIComponent 

But it did not work. returning me null in ob

I also tried:

var canvas:Canvas = new canvas();
canvas.createComponentFromDescriptor(flexUI.descriptor,false);

Any help in resolving this would be appr开发者_开发问答eciated. Thanks guys.


var canvas:Canvas = new canvas();
canvas.createComponentFromDescriptor(flexUI.descriptor,false);
canvas.validateNow();


AFAIK, you can't clone DisplayObject. Your best bet is recreate it with same parameters, for example, have a custom class for it, create new instance and feed same data into it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜