Discuss Scratch

NathanzGames
Scratcher
9 posts

.SBX to .SWF / HTML5

Is it possible to convert a ScratchX file (.sbx) to flash or HTML5? (So you can display your game on a website) I know how to convert .sb2 to .swf, but does this work on ScratchX files?

when I start as a clone
forever

say [I will destroy the universe!]
end
THEFalconPunch
Scratcher
6 posts

.SBX to .SWF / HTML5

Sorry if I'm late, but I wanna answer this for other people as well.

I just tried your suggestion with JuneBeetle's .sb2 to .swf converter, and it did work… kinda.
It converted the file to .swf (flash) but the extensions I've tested (the text-to-speech and a browser cookie thing) didn't seem to work, maybe because I'm using a standalone version of flash.

Last edited by THEFalconPunch (Nov. 3, 2016 01:05:49)


when green flag clicked
ask [Was I helpful?] and wait
if <(answer) = [yes]> then
say [Great!]
say [:)]
else
say [What did I do wrong?]
say [:(]
end
Check out my projects here!
superben100
Scratcher
500+ posts

.SBX to .SWF / HTML5

I don't believe it's possible with Junebeetle's converter. Here's why:

Junebeetle's converter does not recognize the file format “.SBX”. It was designed for “.SB2” files. His SB2 to SWF converter works by bundling a copy of Scratch itself, along with the SB2 file, which you supply it with, into an SWF file. The usual Scratch editor can't handle SBX files, because the Scratch Team didn't want it to. They wanted to keep Scratch X seperate from Scratch for various reasons. That's why they have a seperate website for Scratch X.

So after they created another website, the ST had to create a new editor specifically designed to load Scratch X extensions. And here is where the SB2 to SWF converter fails. As mentioned before, Junebeetle's converter simply bundles a copy Scratch (not Scratch X), with a copy of the SB2 which you supply it with. So when you try to bundle an SBX file with a copy of regular Scratch, what do you get? You get a defective SWF file that won't load.

But the SB2 to SWF converter sees it coming, and won't bundle Scratch with an SBX file. Instead a gives you a nice “The file you've entered is not an SB2 file. Please try another file.” error. (Or something along those lines.)

Now, it may be possible to create an SBX to SWF converter, but that would probably take a lot of coding.

Last edited by superben100 (Dec. 16, 2016 15:06:41)


That was my first choice too, but replicating the lamb's intestines,
it could be tricky. And every time I try to heat the blood, it coagulates in the milk.

-Neelix (Star Trek Voyager, Fair Haven)
pkexe
Scratcher
84 posts

.SBX to .SWF / HTML5

To make the blocks in HTML, you may need image files, but running them means you need graphics (canvas will do, and the element is explained below) and JavaScript to access the src attribute of the image (explained below) and do some other stuff on the canvas.

HTML Canvas:
<canvas width="400" height="400" id="c">
This sets the width and height attributes to 400 and can be accessible with JavaScript with the id attribute c.

HTML Images:
<img src="your source" >
This adds an image with the src attribute your source and the src attribute tells the browser the source




You can make reporters, booleans / predicates, c-blocks, drop-down menus with Blue.
You can set and get temporary variables with Blue

// I use def instead of define to prevent errors

def ( custom reporter (arg1 :: custom) (arg2 :: custom) :: custom) :: hat custom
set temporary variable [foo] to [foo] :: custom stack
. . .
report [(get temporary variable [foo] :: custom)] :: custom cap
BGMead
Scratcher
1000+ posts

.SBX to .SWF / HTML5

NathanzGames wrote:

Is it possible to convert a ScratchX file (.sbx) to flash or HTML5? (So you can display your game on a website) I know how to convert .sb2 to .swf, but does this work on ScratchX files?
If you would like to add it to a website, click the “Embed” button under your project. Add the HTML code to your website.

Powered by DjangoBB

Standard | Mobile