home *** CD-ROM | disk | FTP | other *** search
- class Game.PongSelectorItem extends MovieClip
- {
- var dispatchEvent;
- var group;
- var value;
- var __selected = false;
- static var __inited = false;
- function PongSelectorItem()
- {
- super();
- if(!Game.PongSelectorItem.__inited)
- {
- this.init();
- }
- this.hitArea._visible = false;
- }
- function set selected(flag)
- {
- this.__selected = flag;
- this.onRollOut();
- }
- function get selected()
- {
- return this.__selected;
- }
- function init()
- {
- mx.events.EventDispatcher.initialize(Game.PongSelectorItem.prototype);
- Game.PongSelectorItem.__inited = true;
- }
- function onRelease()
- {
- this.dispatchEvent({type:"click",value:this.value,group:this.group});
- }
- function onRollOver()
- {
- this.dispatchEvent({type:"rollOver",value:this.value,group:this.group});
- if(!this.__selected)
- {
- §§push(this.gotoAndStop("over"));
- }
- }
- function onDragOver()
- {
- this.onRollOver();
- }
- function onRollOut()
- {
- this.dispatchEvent({type:"rollOut",value:this.value,group:this.group});
- !!this.__selected ? this.gotoAndStop("down") : this.gotoAndStop("up");
- }
- function onDragOut()
- {
- this.onRollOut();
- }
- }
-