WTF Flex 4.5.1 eat shit SDK for UIComponent

TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/drawBackground()
at fl.controls::LabelButton/draw()
at fl.core::UIComponent/drawNow()
at fl.controls::ScrollBar/draw()
at fl.core::UIComponent/callLaterDispatcher()

I know u meet this error

i know you read this:

or this

but still cant play the UIScrollbar
What i think is, i the past, i use this method still can use, i think it is the issue of flex sdk, okok,

i got it

// trick to bring in the skins for the button
sb.setStyle( “ScrollArrowDown_downSkin”, new ScrollArrowDown_downSkin());
sb.setStyle( “ScrollArrowDown_overSkin”, new ScrollArrowDown_overSkin());
sb.setStyle( “ScrollArrowDown_upSkin”, new ScrollArrowDown_upSkin());
sb.setStyle( “ScrollArrowUp_disabledSkin”, new ScrollArrowUp_disabledSkin());
sb.setStyle( “ScrollArrowUp_downSkin”, new ScrollArrowUp_downSkin());
sb.setStyle( “ScrollArrowUp_overSkin”, new ScrollArrowUp_overSkin());
sb.setStyle( “ScrollArrowUp_upSkin”, new ScrollArrowUp_upSkin());
sb.setStyle( “ScrollBar”, new ScrollBar());
sb.setStyle( “ScrollTrack_skin”, new ScrollTrack_skin());
sb.setStyle( “ScrollThumb_downSkin”, new ScrollThumb_downSkin());
sb.setStyle( “ScrollThumb_overSkin”, new ScrollThumb_overSkin());
sb.setStyle( “ScrollThumb_upSkin”, new ScrollThumb_upSkin());
sb.enabled = true;
sb.visible = true;

add this, where sb is the scrollbar object 🙂

Posted in: AS3