我有一个带有外部 itemrenderer 的列表组件。我的 itemrender 是一个我想在运行时加载的模块。
我使用了 moduleloader 标签,但它没有显示任何内容。如果我不使用模块加载器标签,<modulename>
而是<productsView:menuBtn>
显示内容。
有谁知道我应该怎么做?
带有列表组件的应用程序文件
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
initialize="catagories.send();">
<mx:HTTPService id="catagories" url="data/products.xml"
resultFormat="e4x"/>
<mx:XMLListCollection id="myXC"
source="{catagories.lastResult.product}"/>
<mx:List id="r" dataProvider="{myXC}"
width="185" height="100%"
backgroundAlpha="0"
paddingTop="0"
paddingBottom="0"
paddingLeft="0"
paddingRight="0"
borderStyle="none">
<mx:itemRenderer>
<mx:Component>
<mx:ModuleLoader url="productsView/menuBtn.swf"/>
</mx:Component>
</mx:itemRenderer>
</mx:List>
</mx:Application>
我的模块
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
layout="horizontal"
width="185"
paddingLeft="3"
paddingRight="3"
paddingTop="3"
paddingBottom="3"
backgroundColor="#FFFFFF"
backgroundAlpha="0.8"
borderStyle="solid">
<mx:Image id="labelIcon" source="{data.icon}"/>
<mx:Label id="catagory" text="{data.catagory}"/>
</mx:Module>