Revision as of 07:32, 1 October 2012 by JSO (talk | contribs) (starting on FAQ. (work in progress))

When a project is running online, it is actually running in an application called either the Java Player or the Flash Player. These players are completely different applications from the Scratch program. They sometimes behave a bit differently from the Scratch Program, which might cause problems for your project.


Note Note: Most of the things listed below are only problems in the Java Player.

Timing

Often, the reason that projects act differently online has to do with the timing of things. There may be several scripts all starting on a given broadcast event that really need to act in a certain order. They work fine in Scratch but, because some events happen a little faster or slower online, they don't work right online. You can usually cure these kind of problems by adding short wait or wait until blocks ahead of the events that should happen later.

Initialization

It also helps if the project initializes properly when the Green Flag is pressed. That means that all the variables are set to the right starting values, all the sprites are put in the right starting place and so on. Any Forever loops that are checking for a certain variable value should have a short wait ahead of them to make sure that the variable has time to get set to the right starting value before the Forever loop starts checking it.

Large Sprites

Sprites can get much larger than the Stage in the Scratch Program. But in the Java Player, sprites cannot be larger than the screen. The only workaround here is to break your very large sprites into smaller values.

Lists

If you try accessing a list item that doesn't exist, the project fails online, but doesn't offline - which can be a pretty common problem in a number of projects. A good workaround is to access item n mod l of the list, where n is the item number you want to find and l is the length of the list.

Mathematical Impossibilities

Division by zero, finding the square root of minus one, trigonometric errors, or other mathematical impossibilities cause the script to fail offline but continue online.

File:Math errors.gif
Examples of mathematical impossibilities.

Obsolete Blocks

Main article: Obsolete Blocks

Obsolete Blocks will stop a script in the Java player, but not not in the Flash or Scratch players. This makes them ideal for online/offline detectors.

External Links