PDA

View Full Version : UILoader.scaleContent not correct?


IceMetalPunk
08-13-2008, 01:14 AM
I'm new to Flash, but through some research I've found that I can use the UILoader component to load images from a URL. This works fine.

I am having problems, though, with the scaleContent property. I have a UILoader component on the satge with an instance name of MainImage. Then I have a code similar to this in AS3:

MainImage.load(new URLRequest("IMAGE_URL_HERE"));
MainImage.width=800;
MainImage.height=400;
MainImage.scaleContent=true;

This should scale the image (which is over 1000x1000) down to 800x400, correct? Instead, the image is scaled down much tinier.

I don't know the exact size, but the stage is 800x400, and the resulting image is much smaller than the stage...MUCH smaller. If I had to guess, I'd say it's down to about 150x100.

Am I doing something wrong?

-IMP ;) :)

IceMetalPunk
08-14-2008, 12:32 AM
Well, I never did figure out what was wrong. But I made a quick workaround that automatically resizes it in proportion by calculating the w/h ratio, then setting the new width & height manually. It works for my purposes, but is much longer than scaleContent=true.

For future reference, has anyone had this problem, and how is it fixed?

-IMP ;) :)