I've exported some of the User-Interface components inside of the Adobe Animate into a .swc
file to be used at runtime:
public class Main extends Sprite {
public function Main() {
var checkbox:CheckBox = new CheckBox(); // fl.controls.CheckBox
checkbox.label = "Row";
addChild(checkbox);
}
}
It's working nice with the Adobe Flash Builder; but using the IntelliJ IDEA, that I do need to go with, only behaves weirdly sometimes, and argues in unexpected ways of:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.controls::CheckBox/drawLayout()
at fl.controls::LabelButton/draw()
at fl.core::UIComponent/callLaterDispatcher()
or sometimes, argues with the following message (with a fl.controls.NumericStepper
in the following example):
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/drawBackground()
at fl.controls::BaseButton/draw()
at fl.core::UIComponent/drawNow()
at fl.controls::NumericStepper/drawLayout()
at fl.controls::NumericStepper/draw()
at fl.core::UIComponent/callLaterDispatcher()
for the really no rational reason!! I've been searching for solutions (and even reasons!) for many hours and tried what I could've thought of! (e.g: I put the routine in an Event.ADDED_TO_STAGE
handler; I tested multiple combinations of the components for the exported file, and I do use the latest versions of the applications and the SDK.)
Please shed some lights on this as it randomly appears with identical code just for the fun of annoyment!! I appreciate any feedback as I'm totally out of ideas!
Thank you in advance :)