----- Original Message ----- From: "Gregory N" <greg.gousa...@gmail.com>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, February 19, 2009 6:12 PM
Subject: Re: [Flashcoders] component def doesn't pass params to constructor?


Muzak,

Nice addition, thanks for pointing to it.
Frankly, I'd prefer to avoid calling commitProperties() after *each*
of the setters...
Anyway, this way looks better than my enter_frame trick :-)

However, the problem " none of the setters are called if no
inspectable params were changed" still remains. So we have to
duplicate default values in [Inspectable] and constructor/declaration
(or some init function)


You shouldn't rely on them as "init" properties (if that makes sense) but as a way for "a user" to changed them "visually" (in the IDE). So yes, you have to define defaultValue="blah", but I guess that's because Flash (the IDE) has no way of knowing what the corresponding internal property is (if any).

private var _prop:String = "Hello";
[Inspectable(defaultValue="Hello")]
public function set prop(value:String):void {
   //
}

Personally I don't see that as a huge problem.

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

Reply via email to