I am facing a particular problem which I am unable to resolve. I am using ActionScript 3 with Robotlegs framework. I have to make a series of URL Requests in a command. Each URL gives an image. I am pushing these images into an ArrayCollection and then dispatching an event with this ArrayCollection as the payload. This ArrayCollection is sent to a view which uses an itemRenderer to display the images. I have checked that images are being loaded to the ArrayCollection but the images are not being displayed in the view.
This is what I have written in the command,
var arrayCollect:ArrayCollection = new ArrayCollection();
var my_loader:Loader = new Loader();
my_loader.load( new URLRequest( "http://www.joomlaworks.net/images/demos/galleries/abstract/7.jpg" ) );
arrayCollect.addItem(my_loader as Object );
my_loader.load( new URLRequest( "http://www.joomlaworks.net/images/demos/galleries/abstract/8.jpg" ) );
arrayCollect.addItem(my_loader as Object );
return arrayCollect;
Then the arrayCollect is being dispatched in a event as payload.
dispatch( new XYZEvent ( XYZEvent.LOAD_COMPLETE, arrayCollect ) );
In the view, I used an itemRenderer.
<s:List id="pqr"
dataProvider="{data}">
....
</s:List>
The images are not being displayed. I think the problem is that the data in the arrayCollection are objects of type 'loader'. So I tried to typecast it as a BitmapImage, but it did not resolve the issue.
Please help me resolve this.