Saving data on your local computer
AS3 provides a class,
SharedObject, to let us save a limited amount of data on our local computer. The class does not create cookies, but something very similar called LocalSharedObjects, and the concept is the same.
It's very important to understand that LocalSharedObjects maintain local persistence. This means that you can play the game, make an high score, turn off your computer, and next time you'll play the game on the same computer, it will retrieve the high score.
Exactly what we need. Let's see how to use it. First, we need to import the
import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.filters.GlowFilter; import flash.net.SharedObject; ...