home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / smashout.swf / scripts / __Packages / Game / PongSelectorItem.as < prev   
Encoding:
Text File  |  2005-11-09  |  1.3 KB  |  57 lines

  1. class Game.PongSelectorItem extends MovieClip
  2. {
  3.    var dispatchEvent;
  4.    var group;
  5.    var value;
  6.    var __selected = false;
  7.    static var __inited = false;
  8.    function PongSelectorItem()
  9.    {
  10.       super();
  11.       if(!Game.PongSelectorItem.__inited)
  12.       {
  13.          this.init();
  14.       }
  15.       this.hitArea._visible = false;
  16.    }
  17.    function set selected(flag)
  18.    {
  19.       this.__selected = flag;
  20.       this.onRollOut();
  21.    }
  22.    function get selected()
  23.    {
  24.       return this.__selected;
  25.    }
  26.    function init()
  27.    {
  28.       mx.events.EventDispatcher.initialize(Game.PongSelectorItem.prototype);
  29.       Game.PongSelectorItem.__inited = true;
  30.    }
  31.    function onRelease()
  32.    {
  33.       this.dispatchEvent({type:"click",value:this.value,group:this.group});
  34.    }
  35.    function onRollOver()
  36.    {
  37.       this.dispatchEvent({type:"rollOver",value:this.value,group:this.group});
  38.       if(!this.__selected)
  39.       {
  40.          ┬º┬ºpush(this.gotoAndStop("over"));
  41.       }
  42.    }
  43.    function onDragOver()
  44.    {
  45.       this.onRollOver();
  46.    }
  47.    function onRollOut()
  48.    {
  49.       this.dispatchEvent({type:"rollOut",value:this.value,group:this.group});
  50.       !!this.__selected ? this.gotoAndStop("down") : this.gotoAndStop("up");
  51.    }
  52.    function onDragOut()
  53.    {
  54.       this.onRollOut();
  55.    }
  56. }
  57.