Hi, I'm trying to retrieve a directory (AIR) with only images in it, then
display a thumbnail for each file using a tilelist. But, I wonder why this
code doesn't work:

 

private function OnInit():void{

      var file:File = File.applicationStorageDirectory;                 

      file.addEventListener(FileListEvent.DIRECTORY_LISTING, handleDIR);

      file.getDirectoryListingAsync();

}

            

[Bindable]

private var arrImage:Array = new Array();

            

private function handleDIR(event:FileListEvent):void{

      for each(var afile:File in event.files){

            if(afile.extension == 'jpg'){

                  var aImg:Image = new Image();

                  aImg.source = afile.nativePath;

                  arrImage.push(aImg);

            }     

      }

}

 

And the Tilelist control:

<mx:TileList id="displayimg" dataProvider="{arrImage}"
itemRenderer="mx.controls.Image" width="100%" height="100%"></mx:TileList>

 

 

Any idea? Thanks in advance.

 

_____________________________________________

Claudio M. E. Bastos Iorio

 <http://www.blumer.com.ar/> http://www.blumer.com.ar

 

Reply via email to