#1  
Old 10-19-2006, 11:20 AM
Nemisari's Avatar
Nemisari Nemisari is offline
Knight
 
Join Date: May 2005
Posts: 530
Nemisari is on a distinguished road
Send a message via AIM to Nemisari
Lightbulb The Open Source Alternative to Flash

After extensive research into an Open Source alternative to the Flash development platform, I've realised it's possible.. but not easy. First of all, there's not one program that can do the entire song and dance, but there are a few programs that, when used together, can come close. If you don't mind using Actionscript to do all of your animations, and you're somewhat technologicaly enabled (or just able to follow simple instructions) then a free option to flash is viable for you.

The set of software I use is Inkscape, a neat and powerfull vector graphics program; SWFTools, a set of simple swf conversion and utility tools; and FlashDevelop, an awesome ActionScript editor, asset manager and Flash generation software.

Inkscape is used for creating the graphics that will be used in your flash movie. It's unfortunate that Inkscape can't export directly to swf format, but after exporting your graphic to pdf, you can convert the pdf to an swf using SWFTools. Then using FlashDevelop, write the actionscript to tie all the movie clips together and export it as an swf. Sounds pretty simple right?

Inkscape

Inkscape is quite robust with many options that may not be obvious at first glance. I suggest reading a few of the tutorials under help, especially the Basics and Shapes tutorial that covers keyboard functions.

Note: our conversion tool does not support gradients, or transparency. The lack of gradient support is unfortunate, but the Transparency can be handled through Actionscript

Keep each movie clip in it's own file, otherwise there will be hell to pay when you want to seperate them later at the conversion stage.

Once you're finished drawing, save it using "Save As..." and select the file type "PDF with Transparency (*.pdf)" for this tutorial we'll be using the file c:\example.pdf

SWFTools

This set of tools is dos based, so we'll have to use the command console to use them. Under "Start" click "Run..." and run the command "cmd" (without the quotation marks). Navigate to the folder where you installed SWFTools (default is c:\swftools), from here there are many tools available to us, but we'll be concentrating on pdf2swf.exe and swfextract.exe

pdf2swf.exe will do basically what you expect it to do, take a pdf file and convert it to swf. This unfortunately creates a white page behind your drawing, destroys all gradients and screws up transparencies. the command for this operation is:
Code:
pdf2swf.exe c:\example.pdf -o example.swf
the -o example.swf is used to specify what you want to call your converted swf file.

Now that we have our converted swf file, we want to get rid of the white page that is behind our graphic. There's actually two layers we want to get rid of, one is black and on the lowest layer, and the white one that is just above the black one. This will leave us with only the graphic with no background. To do this we need to extract all the object from the swf, except for the first two. First we need to find out how many objects are in our swf by using the command
Code:
swfextract.exe example.swf
this will give us some information about our swf clip. We want to take all the shapes from the swf except for shape 1 and 2 (which ate the white and black pages of the background) so we will use the command
Code:
swfextract.exe -P -i 3-24 -o example-results.swf example.swf
the -P (capital P, lower case p is used for extracting jpgs) is required whenever extracting multiple shapes, and the -i 3-(insert highest number shape here) is used for selecting the shapes you want extracted from the swf.

FlashDevelop

FlashDevelop is primarily an ActionScript editor with the ability to manage assets for the Actionscript to interact with. Now that we have some swf movies to play with, we can add them to our project library in FlashDevelop.

To add an swf movie to the library, simply right click on the library folder, go to Add -> Existing File.. then navigate to your swf file. FlashDevelop keeps a copy of the file in your project directory for safe keeping. Now that the swf file is listed, right click on it and choose Add to Library, your swf file is now available for use.


The major draw backs to using this method over Flash, is the lack of time lines and animated drawings. This can be overcome using an ActionScript based animation package like Fuse or writing your own animation script, though it is a bit more cumbersome. There's also the matter of gradients and transpacency, though as these Open Source projects develop further these issues will most likely be resolved. Despite the drawbacks and the complicated process, it saves a few hundred dollars.. which in my opinion, more than makes up for it.

As these tools continue to evolve and mature, I'll update this tutorial to ensure that the easiest and best methods for developing Flash projects with Open Source software are documented.
Reply With Quote
  #2  
Old 10-19-2006, 11:54 AM
IllidanIcerage IllidanIcerage is offline
Knight
 
Join Date: Jan 2006
Posts: 335
IllidanIcerage is on a distinguished road
Default

How fancy can this get? OpenOffice does at least some Flash programming. I've fiddled with it a bit, I think it can do slide shows.

Also, OpenOffice works for exporting things to PDF, which is really nice for my site.
Reply With Quote
  #3  
Old 10-19-2006, 03:18 PM
Nemisari's Avatar
Nemisari Nemisari is offline
Knight
 
Join Date: May 2005
Posts: 530
Nemisari is on a distinguished road
Send a message via AIM to Nemisari
Default

Quote:
Originally Posted by IllidanIcerage View Post
How fancy can this get? OpenOffice does at least some Flash programming. I've fiddled with it a bit, I think it can do slide shows.

Also, OpenOffice works for exporting things to PDF, which is really nice for my site.
This can get really fancy, I'm planning to recreate my Pinball game using only these tools. The meat of an interactive flash site or game is really in the ActionScript, which directs the movie clips around. FlashDevelop is basically an ActionScript editor that allows you to have a library of movie clips for it to play with.

It would have been awesome if I could have used OpenOffice Draw, it supports export to swf, but their swf files are not strict complient, which is required for FlashDevelop... then again, I drew that conclusion before I found SWFTools.. I'll look into it again, I may be able to use the swfextractor to turn the OOo Draw swfs into strict complient swfs.

The swf compiler FlashDevelop uses is called MTASC. It is much more strict when compiling swf than Flash's compiler is, so a lot of "lazy" programers don't bother with the strick standards.
Reply With Quote
  #4  
Old 11-05-2006, 11:18 PM
Photics's Avatar
Photics Photics is offline
Webmaster
 
Join Date: May 2005
Location: Staten Island, NY
Posts: 3,260
Blog Entries: 71
Photics is on a distinguished road
Default

Quote:
Originally Posted by Nemisari View Post
This can get really fancy, I'm planning to recreate my Pinball game using only these tools.
How's the development going Nemi? Does this process really work for you?

I've been meaning to get working on some new Flash games, but it is a difficult thing to do. It's tough with the full blown version of Macromedia Studio 8. The guide is impressive, but it makes me wonder if it's worth the trouble.

That's what this guide lacks... a live example!

Oh... and +1 to Nemi's Rep!
__________________
Michael Garofalo
Webmaster - http://photics.com
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
An Open Letter To ArenaNet Photics Guild Wars 1 06-07-2008 04:04 PM
Let's Make A Flash Game! Photics Animation and Game Development 11 02-01-2007 11:28 AM
Xunlai Tournament House Now Open! RSS FEED Guild Wars 0 12-12-2006 04:00 PM
Disabiling the Right-Click Menu for Flash Games Photics Animation and Game Development 0 11-28-2006 09:58 PM
The Idea: Photics.com Flash Arcade Photics Animation and Game Development 0 11-14-2006 11:57 PM


Portions of this website are part of the Guild Wars Fansite Program. Guild Wars is a trademark of NCsoft Corporation. All rights reserved. Arena.net, ArenaNet and the ArenaNet logo are trademarks or registered trademarks of NCsoft Corporation in the U.S. and/or other countries. The Photics.com webserver is powered by HostRocket.
All times are GMT -4. The time now is 06:04 AM.

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.