What exactly do you mean by clone. You are wondering if you can write a clone() method for it? Is it a component? If so what is the root tag of the MXML component?
Yes, I was wondering if I could use a clone method. The root is TitleWindow.
Normally you would use ObjectUtil.copy(...) but it warns that you cannot copy UI Components.
Mainly because it copeis all the internal variables Flex uses to uniquely identify a component as well and messes things up.
When we've faced this in the past, we've had to create a new instance of the component and copy over the values you are interested in.
You probably want this: http://stackoverflow.com/questions/1086436/clone-flex-component
private function clone(source:Object):*
var myBA:ByteArray = new ByteArray();
myBA.position = 0;
Thanks everyone, need to think about it.
I don't know if this still works in Flex 4 but you could try it...
I had a similar problem and resolved it by using the descriptor
property and the createComponentFromDescriptor method from the
in the flex help there is a lot of documentation too..