views:

60

answers:

2

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

<mx:SWFLoader id="imgLoader" scaleContent="true" width="100" 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?

+1  A: 

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

MysticEarth
Works! Thanks..
Yeti
A: 

I use SWFLoader to load another flash, but the loaded flash seem shifted left so that part of its left side is invisible. If the flash is run standalone, it run well. I've set horizontalAlign="center" verticalAlign="middle".

How can I center the content? Thanks.

bmkhoa