Mirror of a decomp of the Scratch 2.0 Online Editor
  • ActionScript 92.7%
  • AngelScript 7.3%
Find a file
2026-03-05 08:39:31 -05:00
scratch-flash@72e4729b81 Initial commit 2026-03-03 15:53:03 -05:00
src Misc formatting fixes 2026-03-05 08:39:31 -05:00
.gitattributes Initial commit 2026-03-03 15:53:03 -05:00
.gitignore Initial commit 2026-03-03 15:53:03 -05:00
.gitmodules Misc formatting fixes 2026-03-05 08:39:31 -05:00
build.gradle Start formatting ScratchOnline.as 2026-03-03 18:01:44 -05:00
COPYING Initial commit 2026-03-03 15:53:03 -05:00
gradlew Initial commit 2026-03-03 15:53:03 -05:00
gradlew.bat Initial commit 2026-03-03 15:53:03 -05:00
README.md I think we're done! 2026-03-04 15:47:45 -05:00
scratch.gradle Start formatting ScratchOnline.as 2026-03-03 18:01:44 -05:00
TRADEMARK_POLICY Initial commit 2026-03-03 15:53:03 -05:00

Scratch 2.0 online editor and player decompilation


This is a complete decompilation of the Scratch 2.0 online editor. This code has been released under the GPL version 2 license. Forks can be released under the GPL v2 or any later version of the GPL.

If you're interested in contributing to Scratch, this repository is not what you're looking for.

Building

The Scratch 2.0 build process now uses Gradle to simplify the process of acquiring dependencies: the necessary Flex SDKs will automatically be downloaded and cached for you. The Gradle wrapper is included in this repository, but you will need Java Runtime Environment or Java Development Kit version 8 in order to run Gradle; instructions on how to get it for most operating systems are in MrComputer1's Scratch 2.0 Modding Tutorial. Note that you only have the read the Obtaining an older version of Java section, the rest doesn't apply to us. On Arch Linux, read the friendly manual instead.

The build process expects scratch-flash commit 72e4729 to be cloned in the scratch-flash directory.

There are two versions of the Scratch 2.0 online editor that can be built from this repository. See the following table to determine the appropriate command for each version. When building on Windows, replace ./gradlew with .\gradlew.

Required Flash version Features Command
11.6 or above 3D-accelerated rendering ./gradlew build -Ptarget=11.6
10.2 - 11.5 Compatibility with older Flash (Linux, older OS X, etc.) ./gradlew build -Ptarget=10.2

A successful build should look something like this (SDK download information omitted):

$ ./gradlew build -Ptarget=11.6
Defining custom 'build' task when using the standard Gradle lifecycle plugins has been deprecated and is scheduled to be removed in Gradle 3.0
Target is: 11.6
Commit ID for scratch-flash is: 72e4729
Commit ID for scratch-flash-online is: fabc967
:copyresources
:compileFlex
WARNING: The -library-path option is being used internally by GradleFx. Alternative: specify the library as a 'merged' Gradle dependendency
:copytestresources
:test
Skipping tests since no tests exist
:build

BUILD SUCCESSFUL

Total time: 13.293 secs

Upon completion, you should find your new SWF in the build subdirectory.

$ ls -R build
build:
10.2  11.6

build/10.2:
ScratchFor10.2.swf

build/11.6:
Scratch.swf

These SWF can both be inserted into the apiclone/static directory for usage with APIClone.

Please note that the Scratch trademarks (including the Scratch name, logo, Scratch Cat, and Gobo) are property of MIT. For use of these Marks, please see the Scratch Trademark Policy.

Debugging

Here are a few integrated development environments available with Flash debugging support:

It may be difficult to configure your IDE to use Gradle's cached version of the Flex SDK. To debug the Scratch 2.0 SWF with your own copy of the SDK you will need the Flex SDK version 4.10+, and playerglobal.swc files for Flash Player versions 10.2 and 11.4 added to the Flex SDK.

After downloading playerglobal11_4.swc and playerglobal10_2.swc, move them to <path to flex>/frameworks/libs/player/<version>/playerglobal.swc. E.g., playerglobal11_4.swc should be located at <path to flex>/frameworks/libs/player/11.4/playerglobal.swc.

Consult your IDE's documentation to configure it for your newly-constructed copy of the Flex SDK.

If the source is building but the resulting .swf is producing runtime errors, your first course of action should be to download version 4.11 of the Flex SDK and try targeting that. The Apache foundation maintains an installer that lets you select a variety of versions.