Shared objects have been used for years in browser-based Flash applications. They are sometimes referred to as "Flash Cookies" or "Super Cookies" and do provide much of the same functionality as normal browser-based cookies, but are tailored more to the Flash environment. Normally explicit permissions are needed to save such data using a Flash application on the web; however, using AIR frees us of many of these restrictions.
Create a local SharedObject
to preserve specific application data across sessions. We will use an interactive Sprite
to illustrate this visually:
1. First, we will need to import the following classes:
import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.events.TouchEvent; import flash.geom.Point; import flash.net.SharedObject; import flash.net.SharedObjectFlushStatus; import flash.text.TextField; import flash.text...