381 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Netherlands
  • Referred between 50 and 99 users
  • Sold between 1 000 and 5 000 dollars
Yvo says

He guys,

FD has been a great learning experience for me and making a little money on the side. :D I’m finally getting around to making my own first photo gallery in flash, but there is one thing I’m not sure about yet. I’ve seen many galleries around that use photo’s with different dimensions. It usually has a little frame around it, which first tweens to the size of the next photo and then the photo is loaded in.

Now my question is: If I use the MovieClipLoader class. Is there any way to check what the size is of the photo I loaded? Or do people simply put in the dimensions in the xml file and read it from there?

2671 posts
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 50 and 99 users
  • Sold between 100 000 and 250 000 dollars
  • United Kingdom
  • Won a Competition
Chuckanucka says

yep, you can get the width and height on the onLoadInit function.

381 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Netherlands
  • Referred between 50 and 99 users
  • Sold between 1 000 and 5 000 dollars
Yvo says

Fantastic, thanks for the tip!

3402 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 7-8 years
  • Microlancer Beta Tester
  • Referred between 500 and 999 users
  • Sold between 100 000 and 250 000 dollars
+1 more
bobocel says

Here you go:


/**

Movieclip loader

*/

var listnerGallery : Object = new Object();

listnerGallery.onLoadProgress = function(mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void  
{
    var pct:Number = bytesLoaded/bytesTotal*100;
    if (pct>5) 
        {
        mcLoader._visible = true;
        mcLoader.mcBar._xscale = pct;
        }
};

listnerGallery.onLoadInit = function(mc:MovieClip) 
{
trace(mc._width + " " + mc._height);
};

var objGallery:MovieClipLoader = new MovieClipLoader();
objGallery.addListener(listnerGallery);
objGallery.loadClip("img.jpg", mcHolder);
//objGallery.unloadClip(mcHolder);

381 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Netherlands
  • Referred between 50 and 99 users
  • Sold between 1 000 and 5 000 dollars
Yvo says

Thanks very much for that example Bobocel. Now I don’t have to look it up anymore. Very clear example indeed.

by
by
by
by
by
by