开发者

How to ScaleContent the image inside a TileList

开发者 https://www.devze.com 2023-04-13 00:07 出处:网络
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.

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

精彩评论

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

关注公众号