home *** CD-ROM | disk | FTP | other *** search
- package Code.LIB
- {
- import flash.display.Bitmap;
- import flash.events.Event;
- import flash.events.MouseEvent;
- import flash.filters.DropShadowFilter;
- import flash.geom.Rectangle;
-
- public class _nx518 extends _ja537
- {
-
- public static const stMoveDown:int = 1;
-
- public static const stNoAction:int = 0;
-
- public static const stMoveUp:int = 2;
-
-
- private var mount:Bitmap;
-
- private var label:_pw224;
-
- protected var hitSp:_pd424;
-
- private var state:int;
-
- private var iWidth:Number;
-
- private var iHeight:Number;
-
- public function _nx518(param1:Bitmap, param2:_pw224, param3:Boolean = true, param4:Number = -1, param5:Number = -1)
- {
- var _loc6_:_pd424 = null;
- super();
- this.iHeight = param5;
- this.iWidth = param4;
- if(param1)
- {
- this.mount = param1;
- this.addChild(mount);
- }
- (_loc6_ = new _pd424()).graphics.beginFill(16711680,0);
- if(param5 > 0)
- {
- _loc6_.graphics.drawRect(0,0,param4 * _bm350._tc204,param5 * _bm350._tc204);
- }
- else
- {
- _loc6_.graphics.drawRect(0,0,this.mount.width,this.mount.height);
- }
- _loc6_.graphics.endFill();
- this.hitSp = _loc6_;
- if(param2)
- {
- this.label = param2;
- this._pn173 = this.label.iText.text;
- this.addChild(label);
- }
- this.addChild(_loc6_);
- hitArea = _loc6_;
- if(param3)
- {
- this.filters = [new DropShadowFilter(18 * _bm350._tc204,45,0,0.8,30 * _bm350._tc204,30 * _bm350._tc204,0.4 * _bm350._tc204)];
- }
- this.alpha = 1;
- this.buttonMode = true;
- }
-
- public function get _ol346() : _pd424
- {
- return this.hitSp;
- }
-
- public function set _pn173(param1:String) : void
- {
- var _loc2_:Rectangle = null;
- var _loc3_:Rectangle = null;
- var _loc4_:Number = NaN;
- this.label.Text = param1;
- _loc2_ = this.label.iText.getCharBoundaries(0);
- _loc3_ = this.label.iText.getCharBoundaries(label.iText.text.length - 1);
- if(this.iWidth < 0)
- {
- this.label.x = (this.mount.width - _loc3_.right) / 2;
- this.label.y = (this.mount.height - _loc2_.height) / 2;
- }
- else
- {
- _loc4_ = iWidth * _bm350._tc204;
- this.label.x = (iWidth * _bm350._tc204 - label.width * _bm350._tc204) / 2 + 4;
- this.label.y = 0;
- }
- }
-
- override public function _ry461(param1:MouseEvent) : void
- {
- super._ry461(param1);
- this.alpha = 0.85;
- }
-
- override public function _wy541(param1:MouseEvent) : void
- {
- this.State = stMoveDown;
- }
-
- override public function onEnterFrame(param1:Event) : void
- {
- super.onEnterFrame(param1);
- switch(state)
- {
- case stNoAction:
- break;
- case stMoveDown:
- this.scaleX = this.scaleY = this.scaleY - 0.055;
- if(this.scaleY < 0.9)
- {
- this.State = stMoveUp;
- }
- break;
- case stMoveUp:
- this.scaleX = this.scaleY = this.scaleY + 0.025;
- if(this.scaleX >= 1)
- {
- this.State = stNoAction;
- }
- }
- }
-
- private function set State(param1:int) : void
- {
- this.state = param1;
- switch(state)
- {
- case stNoAction:
- this.scaleX = 1;
- this.scaleY = 1;
- }
- }
-
- override public function _im316(param1:MouseEvent) : void
- {
- super._ry461(param1);
- this.alpha = 1;
- }
- }
- }
-