I am trying to duplicate a flex component at run time.
For example if i have this
mx:Button label="btn" id="btn" click="handleClick(event)"/>
i should be able to call a function called DuplicateComponent() and it should return me a UI component thts exactly same as above button including the event listeners with it.
Can some one help me please??
Thanks in advance
Best Answer
Do a Byte Array Copy. This code segment should do it for you:
One note, I did not write this code myself, I'm pretty sure I got it from a post on the Flex Coder's list.