Setting component behaviours dynamically

Hi,

I’ve so far written a script to read data from an XML file and create label components with text from the XML file written on them.

If I create a single label on the stage I can see how to change its behaviour (I want to make it draggable), but can’t figure out how to change the behaviour of components I create at runtime. Does anyone know how I can do this?

TIA!

Gareth