[thelist] Flash: Scaling a loaded image to Xpx and Ypx?

Frank framar at interlog.com
Mon Oct 14 21:23:01 CDT 2002

I'm still in the painful newbie stage of learning Flash MX
Action Script. I've learned how to dynamically load a jpg
into a movie. The images that will be uploaded will very
rarely be of the exact same dimensions, so scaling percent
wise doesn't exactly do what I want. I would like to scale
an image up and down to a precise amount of pixels (say,
150px high by 250px wide)

Here is my current code, can someone offer an alternative?

function displayImg(img, imgMC, imgHeight, imgWidth) {
        img = loadMovie(img, imgMC);
        img._yscale = imgHeight;
        img._xscale = imgWidth;
img = "http://localhost/Test/249-2.jpg";
imgMC = "myImage";
displayImg(img, imgMC, 125, 200);


Frank Marion
Tel. 416 825 7488
framar at interlog.com

More information about the thelist mailing list