views:

349

answers:

1

I need to load multiple swf in a list like control so that I can load all the swf from the folder and show them to the user, then the user can select any one and view it.

How can I load swf in HorizontalList in Flex3, please send me any example or link regarding this requirement.

Thanks in advance.

+1  A: 

Store the urls of swfs in an array and use it as dataProvider of the list. Use Image as the itemRenderer and assign data as the source url.

//script
[Bindable]
private var urls:Array = ["a.swf", "b.swf", "c.swf"];
//mxml
<mx:HorizontalList dataProvider="{urls}">
 <mx:itemRenderer>
  <mx:Component>
   <mx:Image source="{data}"/>
  </mx:Component>
 </mx:itemRenderer>
</mx:HorizontalList>

PS: Wouldn't it be better show thumbnails and load the swf only when user selects one? It would save a lot of bandwidth.

Amarghosh
ya its working with animation swf(which not having any interactive from user) but problem with swf which as button, by which user can click ..while loading this type of swf, i cant able to select from the list control easily.
vineth
Having interactivity in the thumb swf is not a good idea. Use thumb nail images or plain animated swf without interactivity. Another work around is to use extended Image class as itemRenderer and then disable the mouse actions for the loaded content in the complete handler.
Amarghosh