public class Main extends Sprite { protected var so:SharedObject = SharedObject.getLocal("storage");
public function Main(){ //request 1 MB up front if (so.flush(1024 * 1024) == SharedObjectFlushStatus.PENDING) { so.addEventListener(NetStatusEvent.NET_STATUS, onUserAction); trace("User approval pending..."); } }
public function onUserAction(event:NetStatusEvent):void{ so.removeEventListener(NetStatusEvent.NET_STATUS, onUserAction); switch (event.info.code) { case "SharedObject.Flush.Success": trace("Accepted"); break;