Web DevCenter
oreilly.comSafari Books Online.Conferences.
MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA

Sponsored Developer Resources

Web Columns
Adobe GoLive
Essential JavaScript
Megnut

Web Topics
All Articles
Browsers
ColdFusion
CSS
Database
Flash
Graphics
HTML/XHTML/DHTML
Scripting Languages
Tools
Weblogs

Atom 1.0 Feed RSS 1.0 Feed RSS 2.0 Feed

Learning Lab






SWF Is Not Flash (and Other Vectored Thoughts)

by Jacek Artymiak
05/21/2002

Vector graphics, once the sole domain of desktop publishing types, is now becoming increasingly more popular with Web designers and developers. They use vectors to pack their graphics and animations into small chunks of data using the famous Macromedia Flash authoring application. Combined with a bit of sound and creative coding, the popular "Flash movies" or "SWFs" have become the most widely used format for delivery of rich media -- the new name for the good old multimedia, but delivered over the Web instead of being distributed on the CD-ROM, as was typical in the days of HyperCard and Director.

Over the years, the Macromedia Flash (SWF) File Format, as it is officially called by Macromedia, has become the de facto standard for vector graphics on the Web. It has its weaknesses, but it will be very difficult for other file formats to overturn it.

One such contender is SVG, the official standard for vector graphics developed by the W3C. It has many strengths, such as XML semantics, support from the important standard's body, and growing support from software developers, large and small. But for all the current interest in SVG, we're still waiting for tools that match the functionality offered by Macromedia Flash MX. Also, the SWF file format has been tested in the wide, wild world of the Internet, while SVG is still waiting to be generally accepted (as in being supported out of the box by all major browsers).

Many supporters of SVG like to criticize SWF, because they consider it to be closed, unreadable to humans, and unfit for the enterprise. That's why it's high time to present a different view that will help the readers who are evaluating both technologies decide which one best fits their needs.

The following discussion is not meant to prove that Flash is a superior technology to SVG, but to clear up some misconceptions about Flash and SWF. Of course, being the author of an open source FreeMovie library, I am biased. However, I'm also working on an open source SVG library with similar design goals as FreeMovie, and I try to see the merits of both SVG and Flash.

SWF Is Not Flash Is Not SWF

Flash is often confused SWF. This is a mistake because they're not the same thing. In the broadest sense, Flash is a complete solution: the authoring environment, the content delivery format, and the plug-in that plays the content back. SWF is only a small part of that solution; it's the file format in which content created with the Flash authoring tool is distributed.

SWF Is Not Closed

While SWF is not an open standard like SVG, Macromedia does make it available to the public, and many commercial and open source tools exist for generating and parsing SWF files.

SWF Is Extensible

The SWF specification does allow third parties to extend the basic functionality of the format through the mechanism of custom SWF tags. Macromedia doesn't require third parties to register their extensions. Whether these extensions will be recognized by Macromedia's own player is a different thing, but there is nothing to stop an enterprising developer or a team of developers from writing their own Flash player and incorporating the extended functionality into their own player.

Of course, that may not actually be beneficial to the Flash community as a whole, because there is a danger of splitting the market. On the other hand, if the alternative player was significantly better than Macromedia's own product, users would switch and the market as a whole would not be affected.

As crazy as it sounds, extensions could be used to define an SVG storage SWF tag, which could store an alternative encoding of the same movie so it can be played in either a Flash Player or SVG Viewer. This area still remains to be ventured into by the open source community. Any takers?

SWF Is Not FLA

What Macromedia does keep under wraps is the Flash FLA project file format, but that hasn't stopped the development of competing products like Adobe LiveMotion, which uses its own project file format. Sure, it would be a good move for Macromedia to make the FLA format open so the designers could move their project files from one authoring environment to another. But they can already export movies created in LiveMotion as SWF and import them into Flash MX. It's not the same thing, but it is useable.

We probably shouldn't count on Macromedia publishing the FLA specification anytime soon. It just doesn't seem to be in their best interest as a business, because it's one of the ways that Macromedia can use to protect their share of the Flash authoring tools market.

Related Reading

ActionScript: The Definitive Guide
Mastering Flash Programming
By Colin Moock

Whether it's "right" or not is another matter. No matter how we view it, Macromedia has every right to choose what it wants to give away and what to keep secret. Its decision to publish the SWF specs shows that the company is willing to share some of its knowledge with others. And this is a good thing.

SWF Is Unreadable to the Human Beings, But Does it Have to Be?

True, raw SWF is just as comprehensible as an .EXE file. To understand it, we have to use an SWF parser. But is that a problem? Graphics or animation are very different from text encased in HTML, and being able to view the raw code of an image does not make it any easier to understand, no matter what file format is used.

For all the benefits that XML brings to the table, we have to ask if the ability to display and access the XML structure of some image is so desired by the people who look at that image? Is staring at the SVG or SWF code going to make the message that the image is carrying easier to understand? Did the Dutch masters want us to admire the texture of the canvas they used, or the people they portrayed? That just doesn't make sense.

Besides, there already are parsers for SWF, and it's relatively easy to write an SWF to SVG converter. A pre-release SWF parser module for FreeMovie is doing that already and will be released on SourceForge in a couple of weeks.

Pages: 1, 2

Next Pagearrow