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
instantiate
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
you
having the same architecture for stage components and actionscript
created
class instances. In many ways, the parameterised init() is preferable to
a
parameterised constructor.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders