Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

📄 Contents

  1. Flash Usability
  2. What JavaScript Will Do for You
  • Print
  • + Share This
From the author of

What JavaScript Will Do for You

JavaScript is the key to the success of this workaround. It plays a crucial role in the process of helping the sizeGetter.swf file determine whether the user has indeed changed the text size in the browser.

JavaScript will help you to determine the height of the DIV element and then redraw the Flash movie at the new height. The Flash movie can then calculate the percentage that the size has changed and send it to your main movie. Sounds complicated, but it will make sense in no time.

The different browsers on the Macintosh and Windows platforms all react slightly differently, so you will need to have some JavaScript "sniff" out what browser and platform the user has and make the appropriate decisions based on that. Browser sniffer code is quite common, so rather than write it yourself, you can use The JavaScript Browser Sniffer from WebReference.com. This sniffer code works great and is often updated to support the latest browsers on most platforms.

That's pretty much the breakdown of what JavaScript will be doing in the workaround; other details will be covered as you put the project together. Next it's time to start building the HTML page for the sizeGetter movie.

  • + Share This
  • 🔖 Save To Your Account