I have this small problem. I have mysite, where i have 5 oferts, with 5 huge images, that fits to width and height of browser. Now to do that i use z attribute in as3.
My code looks like this: var hei:int = stage.stageHeight; while(pi1c.width > wid){ pic1.z++; } while(pi1c.height > hei){ pic1.z++; } while(pic1.width < wid){ pic1.z—; } while(pic1.height < hei){ pic1.z—; } while(pi2c.width > wid){ pic2.z++; } while(pi2c.height > hei){ pic2.z++; } while(pic2.width < wid){ pic2.z—; } while(pic2.height < hei){ pic2.z—; }[/code]
wid:int = stage.stageWidth;
This works perfect, but all these pic have diffrent sizes, and it makes a nice pile of code, and lots more work for cpu. All this pictures are displayed at once, and code is run at resize event. Now, does anybody know,s how to calculate how much width/height increase and decrease while playing with z attribute?
Please, any tips.
PS: Also, could someone tell me how i make my code, look like a code i mean how i put it in a border.
