How to ScaleContent the image inside a TileList

297 views Asked by At

im in Flash CS5.

I have a TileList that loads its images from an XML, not all the images are the same size so they do not llook consistent wiyh the TileList.

So i want the TileList to Scale the images it gets from the XML.

How can i do this?

Thank you for any help i received.

1

There are 1 answers

0
The_asMan On BEST ANSWER

This should do what you want.

img.addEventListener(Event.COMPLETE, onLoad )
private function onLoad( e:Event ):void{
  var scale:Number = (targetHeight) / img.contentHeight;
  this.img.scaleX = scale;
  this.img.scaleY = scale;
}