<disclaimer> I have to make a Flash 6 gallery so I can’t use MCL </disclaimer>
There are times when the jpg that is getting loaded doesn’t center correctly. I have done everything that I can think of to check to make sure that it is fully loaded before I try to center it. Here is my code:
[FONT=Courier New][LEFT]
function preloader(num:Number):Void {
picture_mc.loadMovie(images[num]);
preloader_mc._visible = false;
onEnterFrame = function () {
var l:Number = picture_mc.getBytesLoaded();
var t:Number = picture_mc.getBytesTotal();
var per:Number = Math.round(l/t*100);
if (per>0) {
preloader_mc._visible = true;
preloader_mc.gotoAndStop(per);
test_txt.text = "running";
}
if (t>4 && picture_mc._width>0 && picture_mc._height>0) {
test_txt.text = "pictured centered";
delete this.onEnterFrame;
preloader_mc._x = -1000;
preloader_mc._visible = false;
picture_mc._x = BG_mc._x+(BG_mc._width/2)-(picture_mc._width/2);
picture_mc._y = BG_mc._y+(BG_mc._height/2)-(picture_mc._height/2);
}
};
}
[/LEFT]
[/FONT] [FONT=Courier New][LEFT][COLOR=#000000] [/COLOR][/LEFT]
[/FONT] Do you have any theories why the clip will not center correctly?
Ideas?