home *** CD-ROM | disk | FTP | other *** search
/ Practice Anatomy Lab / PAL.ISO / pc / PAL.swf / scripts / __Packages / VersionMonkey.as
Encoding:
Text File  |  2007-03-19  |  2.6 KB  |  105 lines

  1. class VersionMonkey extends com.pixelconsumption.core.CoreComponent
  2. {
  3.    var isLivePreview;
  4.    var __testFile;
  5.    var __productName;
  6.    var __buildVersion;
  7.    var __date;
  8.    var __devEmail;
  9.    var __developerName;
  10.    var __noEmail;
  11.    var __bugWebsite;
  12.    function VersionMonkey()
  13.    {
  14.       super();
  15.       this.init();
  16.    }
  17.    function init()
  18.    {
  19.       if(this.isLivePreview)
  20.       {
  21.          this._visible = true;
  22.       }
  23.       else
  24.       {
  25.          this._visible = false;
  26.       }
  27.       if(this.__testFile)
  28.       {
  29.          this.createMenu();
  30.       }
  31.    }
  32.    function createMenu()
  33.    {
  34.       var _loc2_ = new ContextMenu();
  35.       _loc2_.hideBuiltInItems();
  36.       _loc2_.customItems.push(new ContextMenuItem(this.__productName,this.nullHandler));
  37.       _loc2_.customItems.push(new ContextMenuItem("Version " + this.__buildVersion,this.nullHandler));
  38.       _loc2_.customItems.push(new ContextMenuItem(this.__date,this.nullHandler));
  39.       if(this.__devEmail != "" && this.__developerName != "")
  40.       {
  41.          var _loc3_ = new ContextMenuItem("Email " + this.__developerName);
  42.          _loc2_.customItems.push(_loc3_);
  43.          _loc3_.separatorBefore = true;
  44.          _loc3_.onSelect = mx.utils.Delegate.create(this,this.emailDeveloper);
  45.       }
  46.       else
  47.       {
  48.          this.__noEmail = true;
  49.       }
  50.       if(this.__bugWebsite != "" && this.__noEmail == true)
  51.       {
  52.          var _loc4_ = new ContextMenuItem("Go to Bug Website");
  53.          _loc2_.customItems.push(_loc4_);
  54.          _loc4_.separatorBefore = true;
  55.          _loc4_.onSelect = mx.utils.Delegate.create(this,this.getWebsite);
  56.       }
  57.       else if(this.__bugWebsite != "")
  58.       {
  59.          _loc4_ = new ContextMenuItem("Go to Bug Website");
  60.          _loc2_.customItems.push(_loc4_);
  61.          _loc4_.onSelect = mx.utils.Delegate.create(this,this.getWebsite);
  62.       }
  63.       this._parent.menu = _loc2_;
  64.    }
  65.    function nullHandler()
  66.    {
  67.    }
  68.    function emailDeveloper()
  69.    {
  70.       this.getURL("mailto:" + this.__devEmail);
  71.    }
  72.    function getWebsite()
  73.    {
  74.       this.getURL(this.__bugWebsite);
  75.    }
  76.    function set developerName(dn)
  77.    {
  78.       this.__developerName = dn;
  79.    }
  80.    function set buildVersion(bv)
  81.    {
  82.       this.__buildVersion = bv;
  83.    }
  84.    function set productName(pn)
  85.    {
  86.       this.__productName = pn;
  87.    }
  88.    function set date(d)
  89.    {
  90.       this.__date = d;
  91.    }
  92.    function set devEmail(de)
  93.    {
  94.       this.__devEmail = de;
  95.    }
  96.    function set bugWebsite(bw)
  97.    {
  98.       this.__bugWebsite = bw;
  99.    }
  100.    function set testFile(tf)
  101.    {
  102.       this.__testFile = tf;
  103.    }
  104. }
  105.