Scratch to SWF Converter

Online Converter
Download
Troubleshooting
Creating Executables


Introduction

Have you ever wanted to share your Scratch project outside the official website? Well, now you can. This tool converts Scratch 1.4 (SB) and Scratch 2.0 (SB2) files to Adobe Flash SWF files. Anybody with a Flash Player can view them, and they can even be converted into applications for many operating systems.


Use the Converter

If you have a Flash Player enabled in your browser, you can use the online converter. Otherwise, you will have to download a copy. The source code is also available on that page.


How it Works

Regularly, Scratch 2.0 projects are run by the ActionScript 3 code in the Offline Editor or the website. When you convert a project to a SWF, it's packaged along with a copy of that code. A custom main class is used to read the included Scratch project and settings file. It starts the built-in editor and applies the various settings. (This can include auto-starting the project, turning on Turbo Mode, and hiding certain UI elements.)


License

Scratch is open source and is distributed under the GPL v2 license. As explained in detail here, this requires any derived work to use the same license and share its source code as well. You can find the source code for the converter here and the code for Scratch here. You are free to use this code for whatever you want, but you must share your code too.

Additionally, I was asked by the Scratch Team to include the following message:

Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. See http://scratch.mit.edu.

Resources

These applications and websites were invaluable to me when 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.


Screenshot