Discuss Scratch

krizchong
New to Scratch
3 posts

Scratch 2.0 source code question

I follow https://scratch.mit.edu/discuss/topic/38970/?page=1 to download the source code and compile without changing any code.
git clone https://github.com/LLK/scratch-flash
gradlew.bat build

Then I run Scratch.swf with Flash player, everything is fine, but it cannot load project!

For example, I draw a sprite and put some script, then save it as Testing2.sb2.
Then I load the project, but only the title is changed to Testing2, the sprite and script are all blank as
image link: https://drive.google.com/file/d/13y0tjSvkePutqZyyYMnfY9uVmFjZNT_r/view


But the Testing2.sb is fine when open with standard Scratch Offline Editor.

Anything goes wrong on the source code or process of compiling?
_nix
Scratcher
1000+ posts

Scratch 2.0 source code question

The trouble is that the basic Flash player does not have access to your file system when you are running a local file. The offline editor uses a tool, Adobe AIR, to get access to files. In order to make file access work from a scratch-flash build, you'll have to run an HTTP server (e.g. python3 -m http.server) in the directory, then open and run the Flash file in your browser (e.g. by accessing http://localhost:8000/Scratch.swf). Then file access should work.

Note your browser might try to download the SWF instead of running it directly. If so, you'll have to put an HTML file in the same directory, embedding the SWF like you would any Flash program. (Here is my example of that; note you would have to change “Scrap.swf” to “Scratch.swf”.)

══ trans autistic lesbian enbydoggirls // 16 17 18 19 20, she/they
sparrows one word to the paragraph // <3 // ~(quasar) nebula

Powered by DjangoBB