Scratch in Webpages

I was asked this today if a scratch game could be embedded in a website and didn’t think it was ‘do-able’ – my apologies to Rebecca!

It’s much easier than I thought.

Basically there are 2 files that you need:

  • ScratchApplet.jar and
  • soundbank.gm

These get copied into the same folder as your web page.  You also need to save your game in that same folder as an example my ‘game’ was called button.sb

Now create the index page and you’ll have a folder like this:

image

The index page should contain the code:

<html>
<body>
<applet id=”ProjectApplet” style=”display:block” code=”ScratchApplet” codebase=”./” archive=”ScratchApplet.jar” height=”387″ width=”482″>
<param name=”project” value=”button.sb”>
</applet>
</body>
</html>

I hope you can see that the red text may need changing to the name of your file.

Now run the index file and all should be good.  That’s all there is to it! – it may look ‘techy’ but once you’ve done it once it is really easy.

See this running click here or to download all the files click here (you’ll have to uncompress them before they will work)

One thought on “Scratch in Webpages

Add yours

  1. I think that filetypes with.sb may be blocked by some webservers (IIS) so there may be some ‘fiddling to do yet. If you’re running your own webserver in school then you probably know how to allow this. If you’re using an ISP website then you’ll need to chat to tech support.

    Also I think that it’s a good idea to put the game page, game and files in the top level folder of your website.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: