Discuss Scratch

video_error
New Scratcher
10 posts

.sb2 to .exe/.app [New!] [Tutorial]

So today I was messing around trying to convert a scratch project to an exe that I had thought up of a while ago. I only just started to mess with the idea, and get a successful working .sb2 converted into an .exe. This should work on Mac however it should be noted that I think this only allows you to compile to your own OS(as to my knowledge). Okay, so let's get straight into it. Here is a list of the things you need.

  • Coding experience(Not required but very helpful).
    A project to convert.
    junebeetle's .sb2 to .swf converter.
    Flash Develop(An IDE for flash development).
    And patience.

Okay now that you know what's needed let's proceed. First grab a project you need to convert, as an example I will use PutneyCat's "Car Chase". Right, now lets download the stuff we need. First go to http://junebeetle.github.io/converter/download/, and download the appropriate version. Next go to http://www.flashdevelop.org/community/viewforum.php?f=11/ and download the latest version. Run the Flash Develop setup exe(For windows anyway, go through the install process like on any other Mac machine) and follow prompts and instructions. If it dosen't automatically launch then launch it manually from the folder in which you downloaded it too. It should pop up with a window called “App Man”. Here's what you need to download from the prompt it gives you, check all of the following: FlexSDK + AIR SDK, Adobe AIR and, Flash Player SA. The click “Install 3 items.” and let it install. If the IDE is currently open, then close it and relaunch after downloading.

Once the IDE you've finished these steps, it gets slightly more complicated. First click Project -> New Project. The in the GUI popup select “AIR AS3 Projector”, name it, and select a directory for it. In my case I would name it: Car_Chase. In the “Project” tab located on the right side of the IDE. You should see the following files: References, bat, bin, and src. Expand bat, bin, and src.

Remember junebeetle's converter from earlier? Unzip it and either use the .html file or .swf to run it. I prefer opening the .swf files in my browser as they can read it easily. Select the options you'd like, in my case, I'll choose “Full Screen” and “Show Green Flag Bar”. Now click “Open Scratch File”, and find the location of your scratch project, for me this is on the desktop, the select it. and click “Convert to SWF”. Wait till it's done, and a download prompt should appear, type in a name(Mine is Car_Chase) and add .swf at the end. I'll save mine to the desktop.

Great halfway there! Did ya keep the Flash Develop IDE open? Good because we're going to add the Car_Chase.swf to the bin folder. Right click the bin folder then Add -> Existing File… and navigate to where you saved it too(In my case, the desktop), and select it. Now that it's in the bin folder expand inside the .swf file the expand “Properties”. Next from the very top toolbar click Project -> Properties… then select the AIR version, in my case 21.0(Recommended). In the “Output file:” field type in bin/Car_Chase.swf or whatever your .swf file's name is. Then type in the .swf's dimension sizes from the properties folder in the “Dimensions:” field. Next set the “Background color:” field to the .swf's background color in the properties. And finally Set the “Framerate:” to the framerate listed in the properties folder. Then go into the “SDK” tab and select “AIR 21.0” from dropdown. Navigate over to the “Compiler Options” tab and expand “Additional Compiler Options” node and across from to the cell in another cell. Select this one and type in -swf-version=<the .swf's version in the “Properties” folder>“. In my case this is 14. Click Apply then Ok.

Whew! That was extensive! But wait! we're not done yet! Close the .swf's ”Properties“ node the the .swf's node itself in bin. Now it's time to configure your application. Goto the toolbar and in Projects -> AIR App Properties… Select all you need for your application. Next I suggest making sure the your settings are correct. Goto ”application.xml“ in the ”Project“ file explorer and open it. check the <id></id>, <name></name>, <title></title>, and <content></content>. Make sure that the <content> tag is properly set to your .swf should look like this: ”Car_Chase.swf“ not ”care_ChAse.swf“.

All that's left is finally compiling the application. Go into bat and right click CreateCertificate.bat(May be different on Mac machines) and click Execute. After it says ”Press any key to continue . . .“ you may close the window. Then Press F5 or click the blue run button on the very end of the icon toolbar and it should startup. After it finished starting up you can close it and execute PackageApp.bat which should create an ”air“ folder in the directory tree, inside is a .air application. It's an install wizard that will install your application and Adobe AIR should regognize it. You can run it from the IDE or go into Windows file explorer to where you made the project and inside Car_Chase -> air is the .air file which you can run. To run the .air file in the IDE just right click it and click ”Execute" and follow the install wizard and after it finishes it will install the .exe. Maybe you just want to redistribute the .exe, to do that just go into where you installed it to from opening the wizard and copy all of the files in there a redistribute that. Congrats! You now have a redistributable wizard or .exe!
DrKat123
Scratcher
1000+ posts

.sb2 to .exe/.app [New!] [Tutorial]

Nice
I'm gonna test this out with on of my projects
video_error
New Scratcher
10 posts

.sb2 to .exe/.app [New!] [Tutorial]

DrKat123 wrote:

Nice
I'm gonna test this out with on of my projects
Yeah, well it's a bit of a wall of text, however I'm planning on making a detailed project with pictures and instructions.
DrKat123
Scratcher
1000+ posts

.sb2 to .exe/.app [New!] [Tutorial]

video_error wrote:

DrKat123 wrote:

Nice
I'm gonna test this out with on of my projects
Yeah, well it's a bit of a wall of text, however I'm planning on making a detailed project with pictures and instructions.
Maybe I can grab a few screenshots
THEFalconPunch
Scratcher
6 posts

.sb2 to .exe/.app [New!] [Tutorial]

Or you could get a standalone version of flash, open your swf, and make a projector
DatOneLefty
Scratcher
1000+ posts

.sb2 to .exe/.app [New!] [Tutorial]

what about a sb2 to .py converter lol
osmanyahya
Scratcher
2 posts

.sb2 to .exe/.app [New!] [Tutorial]

when backdrop switches to [ v]
comlarsic
Scratcher
4 posts

.sb2 to .exe/.app [New!] [Tutorial]

the converter doesnt work with me
when green flag clicked
forever
think [imagine]
think [program
think [share]
end

Powered by DjangoBB