|Note:||Most of the things listed below are only problems in the Java Player.|
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.
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.
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.
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.
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.
- 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.