I am wondering how would I scale an image on browser resize with minimum and maximum width and height parameters?
I know how to use the Event.RESIZE function to make my image proportional with the browser using stage.stageWidth/Height, but I am trying to figure out a way to have a movieclip or image scale up or down to a certain dimension such as on browser resize the image max would be 640×480 and the minimum being 320×240. Anyone have a link or any suggestions? I can’t find any forum with the exact answer. Thanks.
Use Math.min() and Math.max() to clamp the values for your width and height. I’m assuming you want the image to scale proportionally.