home *** CD-ROM | disk | FTP | other *** search
- package controller
- {
- import flash.events.Event;
- import flash.events.EventDispatcher;
-
- public class ViewShownController extends EventDispatcher
- {
- private static var _viewed:Boolean;
-
- private static var allowInstantiation:Boolean;
-
- public static var VIEWED:String = "viewed";
-
- private static var instance:ViewShownController = null;
-
- public function ViewShownController()
- {
- super();
- if(!allowInstantiation)
- {
- throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
- }
- }
-
- public static function getInstance() : ViewShownController
- {
- if(instance == null)
- {
- allowInstantiation = true;
- instance = new ViewShownController();
- allowInstantiation = false;
- }
- return instance;
- }
-
- public function set viewed(param1:Boolean) : void
- {
- _viewed = param1;
- dispatchEvent(new Event(VIEWED));
- }
-
- public function get viewed() : Boolean
- {
- return _viewed;
- }
- }
- }
-
-