I'm publishing a SWC from FlashCC for use in a FlashBuilder Air project and I get errors when I compile.
Inside of the SWC I have a MovieClip with a button component (fl.controls.Button). In Flash Builder I can make an instance of the MovieClip but when I run the app I get a coercion error:
cannot convert flash.display::MovieClip@56ebee1 to fl.controls.Button.
If I remove the button component from the MovieClip and recompile the SWC there's no error.
If i simply try to add a button instance like this:
var b:Button=new Button();
trace(b);
addChild(b);
The button traces but I get this error
[object Button]
TypeError: Error #2007: Parameter child must be non-null