Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

probelm with scaleing content in a photo gallery loader

Status
Not open for further replies.
Apr 1, 2007
1
NL
Hello!
I know I might be the 99999999991 to say that but I will say it...I'm a beginer with flash and I have a problem...:)
I'm building a photo gallery which loads jpg photos inside a loader component by using MovieClipLoader.
Everything works just great but my only problem is that I can't scale the content (the jpg's) to the size of the loader component.
I tried everything but the photos are loading bigger then the loader, and I want to have the photos at a bigger resolution then the loader so that I could have good quality on any screen resolution. Here's the actionscript I used, if it's necessary:

//------------------MovieClip Loader---------\\
var mcLoader:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object ();
mcLoader.addListener(myListener)
myListener.onLoadProgress = function (target_mc,bytesLoaded,bytesTotal) {
extLoader_mc._visible = true;
var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
extLoader_mc.extLoaderBar_mc._xscale = pctLoaded;
extLoader_mc.extLoadinBarLines_mc._xscale = pctLoaded-1;
extLoader_mc.pct_txt.text = pctLoaded;
if (bytesLoaded >= bytesTotal) {
extLoader_mc._visible = false;
}
}
mcLoader.loadClip("pics/zernike1.jpg",picViewer_mc.picLoader);


Thanks a lot!
 
You're mixing up the MovieClipLoader Class and Loader Component. You're saying you want to load a JPEG into a Loader Component but your code is using MovieClipLoader Class.

If you want to use the Loader Component, you have to change the code (have a look at the doc) but by default JPEG loaded into Loader Component will be scaled to fit the Loader Component.

If you want to use the MovieClipLoader Class, replace your existing Loader Component with an empty MovieClip (but use the same instance name), and add a piece of code to set the _width and _height of the MovieClip onLoadInit.

You have to decide which route you want to take first.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top