PDA

View Full Version : Update Image List in Flex


picklejar
08-02-2007, 09:50 AM
Ok I have an upload component in Flex which adds the uploaded image to an ArrayCollection which feeds my List component within an Accordian in Flex 3. The problem is when I upload an image it gets added to the ArrayCollection no problem, and all else runs fine except the image doesn't show, it displays the broken link icon???

When I click the Accordian and choose a different menu then go back the image appears???

Any clues?

private function displayImgByCategory():void
{
var imgArray:Array=catImgs.getImgsForCat(cID);
imgByCategory=new ArrayCollection(imgArray);
}



<mx:VBox x="0" y="0" width="100%" height="100%" id="imgBox">
<mx:Accordion id="imgAcc" resizeToContent="true" historyManagementEnabled="false">
<mx:Repeater id="myrep" dataProvider="{categories}">
<mx:VBox id="menuHolder"
label="{myrep.currentItem}"
paddingBottom="5"
paddingTop="5"
paddingLeft="5"
paddingRight="5">
<mx:List id="imgRepeater"
width="350"
height="300"
backgroundAlpha="0"
borderThickness="0"
horizontalScrollPolicy="off"
useRollOver="false"
selectionColor="#F2F2F2"
variableRowHeight="true"
itemRenderer="renderer.ImageListRenderer"
rowCount="4"
dataProvider="{imgByCategory}" />

</mx:VBox>
</mx:Repeater>
</mx:Accordion>