开发者

How to ScaleContent the image inside a TileList

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.


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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜