Forum Moderators: open

Message Too Old, No Replies

scaling to fit loaded content

         

Richard_N

8:17 am on Jul 3, 2005 (gmt 0)



Ok I have seen this effect on a few sites. Movie clip (within a larger movie) loads at say 3oopx by 200pix, it loads (say) a jpg image. Clicking on a button will load another jpg but before/while loading the clip resizes to fit the coming image which is say 400px by 300px.

Now I believ its possible to get the dimensions of the external image etc but before I renvent the wheel and write an actionscript class which will probably end up taking a while, I wondered if anyone else had already done this.

Not being lazy (well maybe) just wondering if I was missing something obvious?

BlobFisk

9:05 am on Jul 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmmm - interesting one. I wonder if you could simplify this by putting the image dimensions as part of the image name, for example, myImage400x400.jpg. Then you could use this as the indicator of the new size while the image loads? The drawback of this is that if you are talking about lots of images you need to rename them all!

How do you get the size of the image from the server before it loads? Or is this done at load time?

Richard_N

9:49 am on Jul 6, 2005 (gmt 0)



You can call the images in by way of an external xml file where you can also of course store the sizes, its then a question of resizing the container clip dynamically and smoothly during load.

Think were getting there, should have a working example soon, but busy with paying stuff at the moment :-)

BlobFisk

10:27 am on Jul 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




You can call the images in by way of an external xml file where you can also of course store the sizes,

Ah - that's what I thought! As far as I'm aware there is no way of querying for the dimensions of an image form the server...