PDA

View Full Version : Aligning images loaded in Loader component


roel018
09-18-2008, 08:34 AM
Hi folks,

I'm trying to find a way to do the following:
I have loaded a simple jpeg into the Loader component.. However, no matter what I try, the image keeps aligning with the left side of the image.. I don't want that however, I want it to align with the right side of the image.. So I want the right side of the image to stick to the right side of the Loader component..

I tried stuff like myLoader.align = "right" etc.. but this doesn't seem to work.

is there any other way to dynamically load an image into flash and have it aligned to the right ?? Thing is, I want to load an image that, no matter how big it is, is always aligned to the right side of a specific area so you can always see the right side of the image..

Please help!

Thnx in advance!
Roel.
:confused:

roel018
09-18-2008, 09:18 AM
function doUpdateImage(imagefile) {
backgrnd.createEmptyMovieClip("tester_mc", 1);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
backgrnd.tester_mc._x = (Stage.width - target_mc._width) - 121;
}
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip(imagefile, backgrnd.tester_mc);
}



doUpdateImage(_root.image1)