13 January 2006

Coding : To Center Loaded Image Tips

We have to wait until the image is fully loaded before you can get it's dimensions, (so that is the onLoad handler in Flash Lite 2, with Flash Lite 1.1 you'll have to embed the image in a swf and use the _framesloaded and _totalframes to check if it is fully loaded). With that done you can access the _width and _height and use:


my_mc._x = Stage.width/2 - my_mc._width/2;
my_mc._y = Stage.height/2 - my_mc._height/2

PPL IAIN Syekh Nurjati Cirebon

Jika ditanya apa yang kau suka dari kehadiran mereka? Mereka punya jawabannya : semangat yang tinggi dengan keingintahuan yang tipikal mahas...