home *** CD-ROM | disk | FTP | other *** search
- class components.ui.SimpleButtonLogic extends components.ui.GenericUIComponent
- {
- var event;
- function SimpleButtonLogic()
- {
- super();
- this.tabEnabled = false;
- this.event = new application.core.EventDispatcher();
- this.gotoAndStop(1);
- this.enable();
- }
- function addListener(holder)
- {
- this.event.addListener(holder);
- }
- function removeListener(holder)
- {
- this.event.removeListener(holder);
- }
- function onBtnRollOver()
- {
- this.gotoAndStop(2);
- }
- function onBtnRollOut()
- {
- this.gotoAndStop(1);
- }
- function onBtnPress()
- {
- this.gotoAndStop(3);
- }
- function onBtnRelease()
- {
- this.gotoAndStop(2);
- }
- function onBtnReleaseOutside()
- {
- this.gotoAndStop(1);
- }
- function enable()
- {
- this.enabled = true;
- this.useHandCursor = true;
- }
- function disable()
- {
- this.enabled = false;
- this.useHandCursor = false;
- }
- function onRollOver()
- {
- if(this.enabled)
- {
- this.event.dispatchEvent("onBtnRollOver",this);
- this.onBtnRollOver();
- }
- }
- function onRollOut()
- {
- if(this.enabled)
- {
- this.event.dispatchEvent("onBtnRollOut",this);
- this.onBtnRollOut();
- }
- }
- function onPress()
- {
- if(this.enabled)
- {
- this.event.dispatchEvent("onBtnPressed",this);
- this.onBtnPress();
- }
- }
- function onRelease()
- {
- if(this.enabled)
- {
- this.event.dispatchEvent("onBtnReleased",this);
- this.onBtnRelease();
- }
- }
- function onReleaseOutside()
- {
- if(this.enabled)
- {
- this.event.dispatchEvent("onBtnReleasedOutside",this);
- this.onBtnReleaseOutside();
- }
- }
- }
-