home *** CD-ROM | disk | FTP | other *** search
- package ENGINE.INTERFACE
- {
- import ENGINE.DISPLAY.OSprite;
- import ENGINE.INTERFACE.ANIMATORS.OA_Alpha;
- import ENGINE.INTERFACE.ANIMATORS.OA_Scale;
- import flash.events.MouseEvent;
-
- public class OButton extends OIObject
- {
-
- public static const iDefAnimators:Array = [{
- "F":OA_Alpha.Make,
- "iSAlpha":0,
- "iEAlpha":1,
- "iPIter":6
- },{
- "F":OA_Alpha.Make,
- "iSAlpha":-1,
- "iEAlpha":0,
- "iPIter":6
- },{
- "F":OA_Alpha.Make,
- "iSAlpha":-1,
- "iEAlpha":1,
- "iPIter":6
- },{
- "F":OA_Alpha.Make,
- "iSAlpha":-1,
- "iEAlpha":0.2,
- "iPIter":6
- },null,null,{
- "F":OA_Alpha.Make,
- "iSAlpha":-1,
- "iEAlpha":0.6,
- "iPIter":6
- },{
- "F":OA_Alpha.Make,
- "iSAlpha":-1,
- "iEAlpha":1,
- "iPIter":6
- },{
- "F":OA_Scale.Make,
- "iSScale":1,
- "iEScale":0.8,
- "iPIter":6
- },{
- "F":OA_Scale.Make,
- "iSScale":0.8,
- "iEScale":1,
- "iPIter":6
- }];
-
-
- public var iHit:OSprite;
-
- public function OButton(param1:Array, param2:Array = null)
- {
- var _loc3_:Array = null;
- _loc3_ = param2 == null ? OButton.iDefAnimators : param2;
- super(param1,_loc3_);
- }
-
- override public function OnRollOver(param1:MouseEvent) : void
- {
- this.prRool = true;
- }
-
- override public function Init() : void
- {
- this.useHandCursor = true;
- this.buttonMode = true;
- super.Init();
- if(this.iHit)
- {
- this.iHit.visible = false;
- this.hitArea = this.iHit;
- }
- }
-
- override public function OnMouseUp(param1:MouseEvent) : void
- {
- this.prPress = false;
- }
-
- override public function OnRollOut(param1:MouseEvent) : void
- {
- if(this.prPress)
- {
- this.prPress = false;
- }
- this.prRool = false;
- }
-
- override public function Free() : void
- {
- this.iHit = null;
- super.Free();
- }
-
- override public function OnMouseDown(param1:MouseEvent) : void
- {
- this.prPress = true;
- if(this.parent is OIObject)
- {
- (this.parent as OIObject).OnPress(param1,this);
- }
- }
- }
- }
-