How to allow SWFs to display at 100% width/height in your browser – but enforce a minimum width and height, in case of a smaller browser window size than you’ve designed for.
With my simple FlashSize script, all you need do is call:
Update: This project is now hosted at GitHub. There are currently known issues with Chrome’s PPAPI plugin architecture. USE AT YOUR OWN RISK.
I recently stumbled over a new AS3 gotcha that seems to be bugging a lot of the Flash community. Apparently a new ‘feature’ of AS3, whereby using the mousewheel inside an embedded Flash movie still scrolls the surrounding browser window (if it has enough content, that is).
This didn’t happen in AS2. If a Flash movie had focus, mousewheel events weren’t sent to the browser window. It wasn’t a problem in FireFox either, until a recent update and adversely affects any AS3 Flash app embedded in an HTML page where you might want to scroll or zoom with the mousewheel while over the Flash, instead of the scrolling the browser window.
I’ve seen a few people get into a pickle over this one. When you’re developing and testing locally, you need to set the ‘Local Playback Security’ setting (sometimes referred to as the ‘use network services’ option) depending on whether you wish to access local external files (e.g. XML files, or images) or some other server (e.g. your dev backend server). You can’t access both from a locally running SWF anymore, since it’s a security risk. So here’s how to set that option in Flash CS3 / CS4 or from within FlashDevelop.