开发者

Flex SWFLoader alignment issue when new image is loaded

开发者 https://www.devze.com 2022-12-19 00:43 出处:网络
I\'ve got a SWFLoader aligned to the center of an App like below: <mx:SWFLoader id=\"imgLoader\" scaleContent=\"true\" width=\"10开发者_JAVA技巧0\" height=\"100\" horizontalCenter=\"0\" verticalCe

I've got a SWFLoader aligned to the center of an App like below:

<mx:SWFLoader id="imgLoader" scaleContent="true" width="10开发者_JAVA技巧0" height="100" horizontalCenter="0" verticalCenter="0"/>

The problem is that when I load new images of various sizes, they are not aligned to the center of the app. If the image is 10x10 pixels it is aligned to 0,0 inside the SWFLoader as opposed to the center of the app. So now it looks like the image is off (-90,-90) off the center.

How do I make it so that the image is always center aligned regardless of it's size?


Just set the horizontalAlign = center and verticalAlign = middle for the SWFLoader. That should do the trick.

0

精彩评论

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