Michael,

It seems your problem is similar to one I had with my components.
The matter is that, unlike their behavior in AS2, in AS3 (CS3)
components setters of  [Inspectable] parameters are called lo-o-ong
AFTER constructor

As described here
 http://www.bit-101.com/blog/?p=1181
So, even if I set my init() as listener for ADDED_TO_STAGE event...
it's still before setters.

for now, I found a solution:
I put my init() in ENTER_FRAME listener and then remove this listener :-)
This means that listeners are called before 1st  ENTER_FRAME event.
Perhaps my solution isn't too elegant.... but it works :-)

Also, be sure to duplicate default values for your parameters :-)

can't say abything regarding empty class in component definition,
however (I've never tried this :-)

On 2/5/09, Mendelsohn, Michael <michael.mendels...@fmglobal.com> wrote:
> Hi list...
>
> I have a class that extends MovieClip.  I made a component definition
> for it with two vars, each with same name/type as defined in the class
> file.  If I instance a new Cat() through code, there are no problems.
>
> But, it doesn't work when I want to instance this component on a
> timeline and set params through the tool palette.  I set the class field
> in the linkage dialog to Cat.  In the component definition dialog, I
> leave the class field empty, but the vars are identical to what are
> declared in the class file.
>
> What am I missing?
>
> Thanks,
> - Michael M.
>
>
> package {
>       import flash.display.MovieClip;
>       public class Cat extends MovieClip {
>               public var catName:String;
>               public var showPole:Boolean;
>               public function Cat(catName:String, showPole:Boolean) {
>                       if (showPole==false) {
>                               pole.visible = false;
>                       }
>                       trace(catName);
>               }
>       }
> }
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>


-- 
-- 
Best regards,
 GregoryN
================================
http://GOusable.com
Flash components development.
Usability services.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to