Lug 13
Piccolo trucco per legare uno skin ad un componente di Flex senza che venga restituito il seguente errore:
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::ScrollBar/draw() at fl.core::UIComponent/callLaterDispatcher() 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/callLaterDispatcher() 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/callLaterDispatcher() 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/callLaterDispatcher() 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/callLaterDispatcher()
Rendere non abilitato e invisibile il componente:
var btn:Button = new Button(); btn.setStyle( "upSkin", new Button_upSkin()); btn.enabled = false; btn.visible = false; addChild( btn );
Questo permette di resettare lo skin.
Ultimi Commenti