I am using an XML-based flash image gallery and I need the images to get smaller if the user's browser window is smaller. And the images would be larger (until they reach their maximum size) when the user makes the browser window larger.
Do you know how I can implement this feature in an XML-based flash program? I can also edit the actual "script" if necessary so please let me know your STEP BY STEP thoughts. :o)
Thanks in advance!
How can I set my flash photo gallery to resize to a user's browser window?
Flash doesn't create content that has flow, meaning that it has no innate awareness of the browser window size and doesn't automatically re-arrange or resize elements on resize as an HTML table would. That basically means you'd have to write code to detect the resize and do particular mathematical rearrangement while resizing happens. It's not a simple process that I can walk you through step by step. I'd recommend getting really familiar with ActionScript - buy a book or something and then you can do this.
The overview is that you have to set the physical width and height of Flash in the HTML to 100% and then inside Flash (on frame 1 of the main timeline) write Stage.scaleMode = "noScale";
This prevents the Flash from actually scaling as a whole meaning that it would scale to 100% (as set in HTML) like a photo would, but wouldn't do it intelligently. So if you have text in the Flash it gets scaled too and it'll be very odd looking. Once that's set then you need to set a handler to watch the size of the stage and scale the images only according to the size of the browser window.
Good luck.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment