Setting Up Web Deployment
Adding Information to a SWF
Whether you’re debugging or just compiling, it is always good practice to have some sort of info panel in your SWF. What do I mean by info panel? This can be an actual overlay or context menu with profiling information, memory usage, build/compile version, the user who compiled that version, and more.
One of the easiest ways to implement an info panel in AS3 is by using the context menu or right-click menu.
Note
If you need a good, basic visual profiler, I highly recommend Shane McCartney’s SWF Profiler Class. It shows your SWF’s memory usage and frames per second in a very visual manner. For more information, see http://lostinactionscript.com/2008/10/06/as3-swf-profiler/.
Since this class is open source, it can also be a good base on which to write your own extension.
Why do we want to add an info panel? Consider the following case: you’re testing a project you’ve been working on with a team, a client, or maybe open source collaborators. But what version was deployed online yesterday? And who uploaded it? And at what time was it created?
An info panel saves you time and energy by enabling you to just right-click on the SWF in that web page—no more opening an FTP connection to find out what time the file was uploaded and other relevant information.
What do we want to accomplish? We want a context menu that shows us information about a file’s date, operating version, and build number; which user compiled it; and a line indicating your ...
Get Automating ActionScript Projects with Eclipse and Ant now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.