Hey Scratchers! Have you ever made an awesome game, but the friend you wanted to send it to didn't have Scratch? Or have you made a project that would be a really cool screensaver, but then you couldn't actually install it? Well, now you can do those things and much more, thanks to my Scratch to Flash converter. It converts an SB or SB2 file to an Adobe Flash SWF file. This allows you to run your Scratch projects offline, put them on your website, convert them to Mac or Windows apps, or send them to people who don't have Scratch installed. You can either use the online converter or you can download a copy of the program to use offline.
To start the online converter, simply click here. You should see the program in the middle of the screen. Click Open Scratch File and browse for the project on your computer. Choose any settings that you want to enable. If you aren't sure, just leave the check boxes unselected. Then, click Convert to SWF. A dialog box should pop up asking to save the file. Type whatever name you want (be sure you add .swf at the end) and then click Save. This will produce a SWF file on your computer! These instructions also apply to the downloadable version. Visit the downloads page to get a copy. Then, you can simply extract the zip file and open Converter.html.
When you play a Scratch game, the Scratch interpreter, part of the Scratch website, runs the project's scripts. It executes each block in the project by running the corresponding ActionScript functions. This converter simply places your project inside a copy of Scratch, along with a loader, a script which automatically reads the SB2 and starts the Scratch interpreter. It also controls any modifications you might have chosen, like hiding the green flag bar or turning on turbo mode by default. The combination of Scratch, the loader, and the project is called a projector. This is your converted SWF file.
Since the converter contains a copy of Scratch to run the project, it must be licensed under the same GPL v2 license as Scratch. You can find the source code for my converter here and the source code for Scratch here. The Scratch Team asked me to include the following message:
Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. See http://scratch.mit.edu.
These applications and websites were invaluable to me when designing and programming this converter. - Scratch source code - Adobe Flex SDK 4.6 - SWF file format specification - 0xED hex editor - Eclipse FDT ActionScript IDE - FFDec free Flash decompiler Also, thanks to millions of posts on ActionScript tutorial and forum websites, especially Stack Overflow.