Hi,
I have a button bur with a lot of elements, defined like this:
var iconObj:Object;
var icon1:SpriteVisualElement = new Icon1();
icon1.width = trousersIcon.height = 50;
iconObj1= {icon: icon1, label: ""};
in one case I want to add more items, in another less ...
When I add 2 of the items to the dataprovider and change to 3 and back to
the 2 it works.
When I add 9 of the items to the dataprovider and change to 9 others I get
an error.
When I add 10 of the items to the dataprovider and change to 9 others I get
an error.
var collection1:ArrayCollection = new ArrayCollection([iconObj1, iconObj2,
iconObj3, ..., iconObj9 ]);
collection2:ArrayCollection = new ArrayCollection([iconObj1, iconObj2,
iconObj3, ..., iconObj9 , iconObj10]);
The error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of
the caller.
at flash.display::DisplayObjectContainer/removeChild()
at
mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$removeChild()[/Users/justinmclean/Documents/ApacheFlex4.15/frameworks/projects/framework/src/mx/core/UIComponent.as:7365]
at
mx.core::UIComponent/removeChild()[/Users/justinmclean/Documents/ApacheFlex4.15/frameworks/projects/framework/src/mx/core/UIComponent.as:7272]
at
spark.skins.mobile.supportClasses::ButtonSkinBase/setIcon()[/Users/justinmclean/Documents/ApacheFlex4.15/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as:648]
at
spark.skins.mobile.supportClasses::ButtonSkinBase/commitProperties()[/Users/justinmclean/Documents/ApacheFlex4.15/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as:279]
at
mx.core::UIComponent/validateProperties()[/Users/justinmclean/Documents/ApacheFlex4.15/frameworks/projects/framework/src/mx/core/UIComponent.as:8751]
at
mx.managers::LayoutManager/validateProperties()[/Users/justinmclean/Documents/ApacheFlex4.15/frameworks/projects/framework/src/mx/managers/LayoutManager.as:605]
at
mx.managers::LayoutManager/doPhasedInstantiation()[/Users/justinmclean/Documents/ApacheFlex4.15/frameworks/projects/framework/src/mx/managers/LayoutManager.as:821]
at
mx.managers::LayoutManager/doPhasedInstantiationCallback()[/Users/justinmclean/Documents/ApacheFlex4.15/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1188]
How can I fix this?
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/Changing-dataprovider-for-buttonbar-tp12926.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.