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.
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.)
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.
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.