Thanks for responding Paul!

So going forward with my custom components, I was trying to avoid two
lines of code, but you're suggesting that?

//Instead of:
var cc:CustomComponent = new CustomComponent("red", 5);

//it's better to do:
var cc:CustomComponent = new CustomComponent();
cc.init("red", 5);

I thought one line of code would be a cleaner technique?

- MM

That's a polarised view that isn't strictly true. If you're dragging 
components to the stage in the IDE, how is the IDE supposed to
the component with the appropriate parameters?

You can always achieve a similar effect by having a parameterless 
constructor coupled with a parameterised init() method. Nothing stopping
having the same architecture for stage components and actionscript
class instances. In many ways, the parameterised init() is preferable to
parameterised constructor.

Flashcoders mailing list

Reply via email to