You can either make a component designed for the
stage OR for instancing through code?

Not really, that's not what it says. Just says that you can't (and IMO should never have to) pass arguments to the constructor when dropped on stage.

If you want "talk" to your component both through AS and when on stage, use [Inspectable] getter/setters
class MyComp {

   [Inspectable]
   public function get symbolName():String {
       return _symbolName
   }
   public function set symbolName(value:String):void {
       _symbolName = value;
       // do stuff with value
   }
}

regards,
Muzak

----- Original Message ----- From: "Mendelsohn, Michael" <michael.mendels...@fmglobal.com>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, February 18, 2009 6:55 PM
Subject: RE: [Flashcoders] component def doesn't pass params to constructor?


Hi list...

Researching my own pesky issue (custom components initializing properly
when they're dragged on the stage at author time), I found this:

if you want to create instances of your classes by dragging them to
the stage, keep in mind that their constuctors can not accept arguments.
Also, keep in mind that Its a really good idea to pick unique names for your custom classes. It's widely agreed class-names should start with the capital letter

Source: http://www.actionscript.org/forums/showthread.php3?t=159332

So, is this true??  You can either make a component designed for the
stage OR for instancing through code?  That seems wrong in AS3.

Any feedback is appreciated.
- Michael M.


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to