Hi all,
I'm trying to tweak an application that helps user create business cards using
Flash.
Usually the backgrounds used for the business card canvas are 72 dpi, but my
client wants to use 300 dpi images.
So, I'm attempting to load a 300 dpi image and scale it down to fit within the
canvas. Sounds easy right?
Look at :
http://www.pickleprint.com/tabid/77/default.aspx?ciID=0&ProdCode=BC&tf=54_F&tb=5
4_B&rx=1280&uID=&txID=54
If you click on zoom out, you can see the background is WAY larger than the
intended area. The alerts show the dimensions of the image before and after the
resize attempt, but the image will not resize on the display.
Here's the code snippet: (fyi, had to publish at Flash Player 7. publishing at
9 had no effect.)
myListener.onLoadInit = function (target_mc)
{
w = _root.MasterWidth; //the height of the desired template
h = _root.MasterHeight; //the width of the desired template
_root.command("alert", target_mc._width); // trace the original width of the
300 dpi background
_root.command("alert", target_mc._height); // trace the original height of the
300 dpi background
target_mc._width = w; // resize attempt
target_mc._height = h; // resize attempt
_root.command("alert", target_mc._width); // trace dimensions after resize
_root.command("alert", target_mc._height);
}
my_mcl.addListener(myListener);
my_mcl.loadClip(_root.ServerPath + "Images/LowRes_Front/" +
_root.FrontTemplateName + "_LR.jpg", _root.FTL);
The image loads, but will not resize down. I've tried several variations and
outside functions to force a resize, and it's ignoring me. _root.FTL is the
name of the movieclip target.
Do you know of any bugs regarding this?
TessandraFae - 31 Jul 2008 18:42 GMT
Got it: Had to put an empty movieclip inside of the FTL movieclip.
thumbHolder = _root.FTL.createEmptyMovieClip("Front", 0);
my_mcl.loadClip(_root.ServerPath + "Images/LowRes_Front/" +
_root.FrontTemplateName + "_LR.jpg", thumbHolder);
Don't know why it works, but it works.