I've written the following custom component, SubNavBar.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" height="100" width="300"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
[Bindable] public var menuItems:XMLListCollection;
private function init():void
{
trace("SubNav: config = "+menuItems);
}
]]>
</mx:Script>
<mx:HBox y="30" id="menu">
<mx:List dataProvider="{menuItems}"/>
</mx:HBox>
</mx:Canvas>
I setup this component in a parent custom component using the following code:
<com:SubNavBar id="subNavMenu" menuItems="{subNavConfig}"
x="10" y="-15">
</com:SubNavBar>
Whenever the trace
function runs in init()
, the property menuItems
returns null
. I don't seem to have this problem with other variable types, like Boolean or String. Is this due to the size of the XMLListCollection object? How can I set up this SubNavBar custom component with XMLListCollection property and bind it to a control in the component?
Thanks!