Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / July 2008



Tip: Looking for answers? Try searching our database.

loadClip onLoadInit will not resize image

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TessandraFae - 31 Jul 2008 17:50 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.