With the number of Web sites using Macromedia Flash Files (.swf files) to present content,
as a Web developer it may come in handy to have an ASP page that could easily read various tidbits of information
about a Flash file. Fortunately, Flash files save a plethora of useful information in their headers.
This information can be read using the FileSystemObject through an ASP page! (To learn more about Flash,
check out FlashKit.com!)
In order to ease the process of reading this information, I created a handy class to do the grunt work for
me. (For more information on using classes with VBScript, be sure to read:
Using Classes within VBScript.) The class I created returns the following
information about a Flash file:
SWFDump Class
Property
Description
Version
The version of the Flash file (3,4 or 5 at the moment)
Height
Expresed in pixels.
Width
Expresed in pixels.
xMin
Expresed in Twips (20 twips = 1 pixel)
xMax
Expresed in Twips
yMin
Expresed in Twips
yMax
Expresed in Twips
FileSize
The total size of the .swf file.
FrameRate
How many frames are in the Flash file.
FrameCounter
Frame counter information.
The use of the SWFDump class is very simple. First off, I recommend that you place it in
an include file so that you can easily include the class in the files that need to read Flash file
information. (For more information on server-side includes be sure to read: The
Low-Down on #include.) I chose to name my include file swfheaderdump.inc.
To use the class, simply use code like the following: