root/lang/actionscript/tinyaction/ReloadButton.as @ 15046

Revision 7784, 1.0 kB (checked in by gyuque, 5 years ago)

tinyaction: fixed constant pool data

Line 
1package
2{
3        import flash.display.*;
4        import flash.geom.Matrix;
5        import flash.text.*;
6       
7        public class ReloadButton extends Sprite
8        {
9                private var mTitle:String;
10                function ReloadButton(t:String)
11                {
12                        mTitle = t;
13                        paint();
14                       
15                        var label:TextField = new TextField();
16                        label.mouseEnabled = false;
17                       
18                        var fmt:TextFormat = new TextFormat();
19                        fmt.align = TextFormatAlign.CENTER;
20                        label.defaultTextFormat = fmt;
21                        addChild(label);
22                        label.width = 80;
23                        label.text = t;
24                }
25               
26                public function get title():String
27                {
28                        return mTitle;
29                }
30               
31                private function paint():void
32                {
33                        var g:Graphics = graphics;
34                       
35                        var fillType:String = GradientType.LINEAR;
36                        var colors:Array = [0xffffff, 0xcacfdc];
37                        var alphas:Array = [100, 100];
38                        var ratios:Array = [0x00, 0xff];
39                        var M:Matrix = new Matrix();
40                        M.createGradientBox(20, 20, Math.PI/2);
41                       
42                        g.beginGradientFill(fillType, colors, alphas, ratios, M);
43                        g.lineStyle(1, 0xffffff, 1, true);
44                        g.drawRoundRect(0, 0, 80, 19, 8, 8);
45                }
46        }
47}
Note: See TracBrowser for help on using the browser.