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.
精彩评论