notice: Flash editor updated! Join the development! Thanks to MiniBuilder


embed

FORKED

[最適化 Tips] 変数名の長さによる処理速度の違い withありなしの処理速度の違い [diff(72)]

  1. // forked from muta244's [最適化 Tips] 変数名の長さによる処理速度の違い
  2. package {
  3. import flash.display.*;
  4. import flash.events.*;
  5. import flash.text.*;
  6. import flash.utils.*;
  7. public class Main extends Sprite
  8. {
  9.     static private const _NUM_TIMES:uint = 10000000;
  10.     
  11.     
  12.     private function _init():void
  13.     {
  14.         _debug(
  15.             "各テスト " + _NUM_TIMES + " 回処理させた計算結果 [単位 : ミリ秒]\n" +
  16.             "(誤差は多少生じます)\n"
  17.         );
  18.         
  19.         _measure("ループのみ"function ():void
  20.         {
  21.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  22.                 
  23.             }
  24.         });
  25.         var sample:Sample = new Sample(102030);
  26.         sample.child = new Sample(102030);
  27.         sample.child.child = new Sample(102030);
  28.         
  29.         _measure("withなし 自プロパティ"function ():void
  30.         {
  31.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  32.                     sample.data1;
  33.                     sample.data2;
  34.                     sample.data3;
  35.             }
  36.         });
  37.         
  38.         _measure("withあり 自プロパティ"function ():void
  39.         {
  40.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  41.                 with (sample)
  42.                     {
  43.                         data1;
  44.                         data2;
  45.                         data3;
  46.                     }
  47.             }
  48.         });
  49.         _measure("withなし 孫プロパティ"function ():void
  50.         {
  51.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  52.                     sample.child.child.data1;
  53.                     sample.child.child.data2;
  54.                     sample.child.child.data3;
  55.             }
  56.         });
  57.         
  58.         _measure("withあり 孫プロパティ"function ():void
  59.         {
  60.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  61.                 with (sample.child.child)
  62.                     {
  63.                         data1;
  64.                         data2;
  65.                         data3;
  66.                     }
  67.             }
  68.         });
  69.         _measure("withなし 子&孫プロパティ"function ():void
  70.         {
  71.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  72.                     sample.child.data1;
  73.                     sample.child.data2;
  74.                     sample.child.data3;
  75.                     sample.child.child.data1;
  76.                     sample.child.child.data2;
  77.                     sample.child.child.data3;
  78.             }
  79.         });
  80.         
  81.         _measure("withあり 子&孫プロパティ"function ():void
  82.         {
  83.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  84.                 with (sample.child)
  85.                     {
  86.                         data1;
  87.                         data2;
  88.                         data3;
  89.                         child.data1;
  90.                         child.data2;
  91.                         child.data3;
  92.                     }
  93.             }
  94.         });
  95.         _debug("\n結果については言及しませんので, 各自ご判断ください.");
  96.     }
  97.     
  98.     private var _field:TextField;
  99.     private var _time:uint;
  100.     
  101.     public function Main():void
  102.     {
  103.         _setup();
  104.         _init();
  105.     }
  106.     
  107.     private function _measure(title:String, func:Function, ...params):void
  108.     {
  109.         _time = getTimer();
  110.         func.apply(null, params);
  111.         _time = getTimer() - _time;
  112.         
  113.         _debug("[ " + title + " ] --> " + _time + " ms");
  114.     }
  115.     
  116.     private function _debug(log:String):void
  117.     {
  118.         _field.appendText(log + "\n");
  119.     }
  120.     
  121.     private function _setup():void
  122.     {
  123.         _field = new TextField();
  124.         _field.width = stage.stageWidth - 40;
  125.         _field.height = stage.stageHeight - 60;
  126.         _field.x = 20;
  127.         _field.y = 60;
  128.         
  129.         var format:TextFormat = _field.defaultTextFormat;
  130.         format.font = "_sans";
  131.         _field.defaultTextFormat = format;
  132.         
  133.         addChild(_field);
  134.         
  135.         var button:Sprite = new Sprite();
  136.         button.graphics.lineStyle(1, 0xBBBBBB);
  137.         button.graphics.beginFill(0xEEEEEE);
  138.         button.graphics.drawRoundRect(001002055);
  139.         button.graphics.endFill();
  140.         
  141.         addChild(button);
  142.         
  143.         button.x = 20;
  144.         button.y = 20;
  145.         button.mouseChildren = false;
  146.         button.buttonMode = true;
  147.         
  148.         var field:TextField = new TextField();
  149.         field.width = 100;
  150.         field.height = 20;
  151.         field.htmlText = "<p align='center'><font face='_sans'>再計算</span></p>";
  152.         
  153.         button.addChild(field);
  154.         
  155.         button.addEventListener(MouseEvent.CLICK, function ():void
  156.         {
  157.             _field.text = "";
  158.             _init();
  159.         });
  160.     }
  161. }
  162. }
  163. class Sample
  164. {
  165.     public var child:Sample;
  166.     public var data1:Number;
  167.     public var data2:Number;
  168.     public var data3:Number;
  169.      
  170.     public function Sample(data1:Number, data2:Number, data3:Number)
  171.     {
  172.         this.data1 = data1;
  173.         this.data2 = data2;
  174.         this.data3 = data3;
  175.     }
  176. }
noswf

[最適化 Tips] 変数名の長さによる処理速度の違い forked from: [最適化 Tips] 変数名の長さによる処理速度の違い [diff(74)]

  1. // forked from muta244's [最適化 Tips] 変数名の長さによる処理速度の違い
  2. package {
  3. import flash.display.*;
  4. import flash.events.*;
  5. import flash.text.*;
  6. import flash.utils.*;
  7. public class Main extends Sprite
  8. {
  9.     static private const _NUM_TIMES:uint = 1000000;
  10.     
  11.     private var ary:Array = [
  12.                                 10000,
  13.                                 01000,
  14.                                 00100,
  15.                                 00010
  16.                             ];
  17.     private var ary2:Array = [
  18.                                 1000255,
  19.                                 0100255,
  20.                                 0010255,
  21.                                 00010
  22.                             ];
  23.     
  24.     private function _init():void
  25.     {
  26.         _debug(
  27.             "各テスト " + _NUM_TIMES + " 回処理させた計算結果 [単位 : ミリ秒]\n" +
  28.             "(誤差は多少生じます)\n"
  29.         );
  30.         
  31.         _measure("ループのみ"function ():void
  32.         {
  33.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  34.                 
  35.             }
  36.         });
  37.         
  38.         _measure("配列の要素を1つ変更"function ():void
  39.         {
  40.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  41.                 ary[4] = 255;
  42.             }
  43.         });
  44.         
  45.         _measure("配列の要素を2つ変更"function ():void
  46.         {
  47.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  48.                 ary[4] = 255;
  49.                 ary[9] = 255;
  50.             }
  51.         });
  52.         
  53.         _measure("配列の要素を3つ変更"function ():void
  54.         {
  55.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  56.                 ary[4] = 255;
  57.                 ary[9] = 255;
  58.                 ary[14] = 255;
  59.             }
  60.         });
  61.         
  62.         _measure("配列の要素を全て変更"function ():void
  63.         {
  64.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  65.                 ary[0] = 1;
  66.                 ary[1] = 0;
  67.                 ary[2] = 0;
  68.                 ary[3] = 0;
  69.                 ary[4] = 255;
  70.                 ary[5] = 0;
  71.                 ary[6] = 1;
  72.                 ary[7] = 0;
  73.                 ary[8] = 0;
  74.                 ary[9] = 255;
  75.                 ary[10] = 0;
  76.                 ary[11] = 0;
  77.                 ary[12] = 1;
  78.                 ary[13] = 0;
  79.                 ary[14] = 255;
  80.                 ary[15] = 0;
  81.                 ary[16] = 0;
  82.                 ary[17] = 0;
  83.                 ary[18] = 1;
  84.                 ary[19] = 0;
  85.             }
  86.         });
  87.         
  88.         _measure("事前に作成した配列の代入"function ():void
  89.         {
  90.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  91.                 ary = ary2;
  92.             }
  93.         });
  94.         
  95.         _measure("新しく配列を作成する([])"function ():void
  96.         {
  97.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  98.                 ary = [
  99.                         1000255,
  100.                         0100255,
  101.                         0010255,
  102.                         00010
  103.                       ];
  104.             }
  105.         });
  106.         
  107.         _measure("新しく配列を作成する(new Array())"function ():void
  108.         {
  109.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  110.                 ary = new Array(
  111.                         1000255,
  112.                         0100255,
  113.                         0010255,
  114.                         00010
  115.                       );
  116.             }
  117.         });
  118.         
  119.         _debug("\n結果については言及しませんので, 各自ご判断ください.");
  120.     }
  121.     
  122.     private var _field:TextField;
  123.     private var _time:uint;
  124.     
  125.     public function Main():void
  126.     {
  127.         _setup();
  128.         _init();
  129.     }
  130.     
  131.     private function _measure(title:String, func:Function, ...params):void
  132.     {
  133.         _time = getTimer();
  134.         func.apply(null, params);
  135.         _time = getTimer() - _time;
  136.         
  137.         _debug("[ " + title + " ] --> " + _time + " ms");
  138.     }
  139.     
  140.     private function _debug(log:String):void
  141.     {
  142.         _field.appendText(log + "\n");
  143.     }
  144.     
  145.     private function _setup():void
  146.     {
  147.         _field = new TextField();
  148.         _field.width = stage.stageWidth - 40;
  149.         _field.height = stage.stageHeight - 60;
  150.         _field.x = 20;
  151.         _field.y = 60;
  152.         
  153.         var format:TextFormat = _field.defaultTextFormat;
  154.         format.font = "_sans";
  155.         _field.defaultTextFormat = format;
  156.         
  157.         addChild(_field);
  158.         
  159.         var button:Sprite = new Sprite();
  160.         button.graphics.lineStyle(1, 0xBBBBBB);
  161.         button.graphics.beginFill(0xEEEEEE);
  162.         button.graphics.drawRoundRect(001002055);
  163.         button.graphics.endFill();
  164.         
  165.         addChild(button);
  166.         
  167.         button.x = 20;
  168.         button.y = 20;
  169.         button.mouseChildren = false;
  170.         button.buttonMode = true;
  171.         
  172.         var field:TextField = new TextField();
  173.         field.width = 100;
  174.         field.height = 20;
  175.         field.htmlText = "<p align='center'><font face='_sans'>再計算</span></p>";
  176.         
  177.         button.addChild(field);
  178.         
  179.         button.addEventListener(MouseEvent.CLICK, function ():void
  180.         {
  181.             _field.text = "";
  182.             _init();
  183.         });
  184.     }
  185. }
  186. }
noswf

[最適化 Tips] 変数名の長さによる処理速度の違い [最適化 Tips] SpriteとMovieClipってそんなに変わるの? [diff(40)]

  1. // forked from muta244's [最適化 Tips] 変数名の長さによる処理速度の違い
  2. package {
  3. import flash.display.*;
  4. import flash.events.*;
  5. import flash.text.*;
  6. import flash.utils.*;
  7. import flash.system.*;
  8. public class Main extends Sprite
  9. {
  10.     static private const _NUM_TIMES:uint = 5000;
  11.     
  12.     private var wrap:Sprite;
  13.     
  14.     private function _init():void
  15.     {
  16.         while(wrap.numChildren) wrap.removeChildAt(0);
  17.         
  18.         _debug(
  19.             "各テスト " + _NUM_TIMES + " 回処理させた計算結果 [単位 : ミリ秒]\n" +
  20.             "(誤差は多少生じます)\n"
  21.         );
  22.         
  23.         var old:int = System.totalMemory;
  24.         _measure("Sprite"function ():void
  25.         {
  26.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  27.                 var sp:Sprite = new Sprite();
  28.                 wrap.addChild(sp)
  29.             }
  30.         });
  31.         _debug("(Spriteのメモリ使用量 : " + int((System.totalMemory - old)/1000) + "KB");
  32.         
  33.         while(wrap.numChildren) wrap.removeChildAt(0);
  34.         System.gc();
  35.         _debug("")
  36.         
  37.         var old1:int = System.totalMemory;
  38.         _measure("MovieClip"function ():void
  39.         {
  40.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  41.                 var mc:MovieClip = new MovieClip();
  42.                 wrap.addChild(mc)
  43.             }
  44.         });
  45.         _debug("(MovieClipのメモリ使用量 : " + int((System.totalMemory - old1)/1000) + "KB");
  46.         
  47.         _debug("\n結果については言及しませんので, 各自ご判断ください.");
  48.     }
  49.     
  50.     private var _field:TextField;
  51.     private var _time:uint;
  52.     
  53.     public function Main():void
  54.     {
  55.         _setup();
  56.         _init();
  57.     }
  58.     
  59.     private function _measure(title:String, func:Function, ...params):void
  60.     {
  61.         _time = getTimer();
  62.         func.apply(null, params);
  63.         _time = getTimer() - _time;
  64.         
  65.         _debug("[ " + title + " ] --> " + _time + " ms");
  66.     }
  67.     
  68.     private function _debug(log:String):void
  69.     {
  70.         _field.appendText(log + "\n");
  71.     }
  72.     
  73.     private function _setup():void
  74.     {
  75.         wrap = new Sprite
  76.         addChild(wrap)
  77.         
  78.         _field = new TextField();
  79.         _field.width = stage.stageWidth - 40;
  80.         _field.height = stage.stageHeight - 60;
  81.         _field.x = 20;
  82.         _field.y = 60;
  83.         
  84.         var format:TextFormat = _field.defaultTextFormat;
  85.         format.font = "_sans";
  86.         _field.defaultTextFormat = format;
  87.         
  88.         addChild(_field);
  89.         
  90.         var button:Sprite = new Sprite();
  91.         button.graphics.lineStyle(1, 0xBBBBBB);
  92.         button.graphics.beginFill(0xEEEEEE);
  93.         button.graphics.drawRoundRect(001002055);
  94.         button.graphics.endFill();
  95.         
  96.         addChild(button);
  97.         
  98.         button.x = 20;
  99.         button.y = 20;
  100.         button.mouseChildren = false;
  101.         button.buttonMode = true;
  102.         
  103.         var field:TextField = new TextField();
  104.         field.width = 100;
  105.         field.height = 20;
  106.         field.htmlText = "<p align='center'><font face='_sans'>再計算</span></p>";
  107.         
  108.         button.addChild(field);
  109.         
  110.         button.addEventListener(MouseEvent.CLICK, function ():void
  111.         {
  112.             _field.text = "";
  113.             _init();
  114.         });
  115.     }
  116. }
  117. }
noswf

[最適化 Tips] 変数名の長さによる処理速度の違い forked from: [最適化 Tips] Faster Math.sqrt? [diff(53)]

  1. // forked from muta244's [最適化 Tips] 変数名の長さによる処理速度の違い
  2. package {
  3. import flash.display.*;
  4. import flash.events.*;
  5. import flash.text.*;
  6. import flash.utils.*;
  7. public class Main extends Sprite
  8. {
  9.     static private const _NUM_TIMES:uint = 1000000;
  10.     
  11.     private var _someNumber:int = Math.random() * 10000;
  12.     
  13.     private function _init():void
  14.     {
  15.         _debug(
  16.             "Math.sqrt vs custom function " + _NUM_TIMES + " cycles.\n"
  17.         );
  18.         
  19.         _measure("Empty loop"function ():void
  20.         {
  21.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  22.                 
  23.             }
  24.         });
  25.         
  26.         _measure("Number reference time"function ():void
  27.         {
  28.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  29.                 _someNumber;
  30.             }
  31.         });
  32.         
  33.         _measure("Math.sqrt"function ():void
  34.         {
  35.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  36.                 Math.sqrt(_someNumber);
  37.             }
  38.         });
  39.         
  40.         _measure("Fast SquareRoot FunctionCall"function ():void
  41.         {
  42.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  43.                FSQRT(_someNumber)
  44.             }
  45.         });
  46.         
  47.         
  48.         _measure("Fast SquareRoot Inline"function ():void
  49.         {
  50.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  51.             var thres:Number = 0.004;
  52.         var b:Number = _someNumber * 0.25;
  53.             var a:Number;
  54.             var c:Number;
  55.     
  56.     do
  57.     {
  58.             c = _someNumber/ b;
  59.             b = (b + c) * 0.5;
  60.             a = b - c;
  61.             if (a < 0) a = -a;
  62.     }
  63.     while (a > thres);
  64.             }
  65.         });
  66.         
  67.      
  68.         
  69.         _debug("\n Either via function call or inline, FastSquareRoot loses");
  70.     }
  71.     
  72.     private var _field:TextField;
  73.     private var _time:uint;
  74.     
  75.     public function Main():void
  76.     {
  77.         _setup();
  78.         _init();
  79.     }
  80.     
  81.     private function _measure(title:String, func:Function, ...params):void
  82.     {
  83.         _time = getTimer();
  84.         func.apply(null, params);
  85.         _time = getTimer() - _time;
  86.         
  87.         _debug("[ " + title + " ] --> " + _time + " ms");
  88.     }
  89.     
  90.     private function _debug(log:String):void
  91.     {
  92.         _field.appendText(log + "\n");
  93.     }
  94.     
  95.     private function _setup():void
  96.     {
  97.         _field = new TextField();
  98.         _field.width = stage.stageWidth - 40;
  99.         _field.height = stage.stageHeight - 60;
  100.         _field.x = 20;
  101.         _field.y = 60;
  102.         
  103.         var format:TextFormat = _field.defaultTextFormat;
  104.         format.font = "_sans";
  105.         _field.defaultTextFormat = format;
  106.         
  107.         addChild(_field);
  108.         
  109.         var button:Sprite = new Sprite();
  110.         button.graphics.lineStyle(1, 0xBBBBBB);
  111.         button.graphics.beginFill(0xEEEEEE);
  112.         button.graphics.drawRoundRect(001002055);
  113.         button.graphics.endFill();
  114.         
  115.         addChild(button);
  116.         
  117.         button.x = 20;
  118.         button.y = 20;
  119.         button.mouseChildren = false;
  120.         button.buttonMode = true;
  121.         
  122.         var field:TextField = new TextField();
  123.         field.width = 100;
  124.         field.height = 20;
  125.         field.htmlText = "<p align='center'><font face='_sans'>Test Again</span></p>";
  126.         
  127.         button.addChild(field);
  128.         
  129.         button.addEventListener(MouseEvent.CLICK, function ():void
  130.         {
  131.             _field.text = "";
  132.             _init();
  133.         });
  134.     }
  135.     
  136.     
  137.     
  138.     public static function FSQRT(val:Number):Number
  139.     {
  140.     var thres:Number = 0.002;
  141.     var b:Number = val * 0.25;
  142.     var a:Number;
  143.     var c:Number;
  144.     
  145.     do
  146.     {
  147.             c = val / b;
  148.             b = (b + c) * 0.5;
  149.             a = b - c;
  150.             if (a < 0) a = -a;
  151.     }
  152.     while (a > thres);
  153.     
  154.     return b;
  155.     }
  156. }
  157. }
noswf

[最適化 Tips] 変数名の長さによる処理速度の違い [最適化 Tips] if ... else と switch での処理速度の違い [diff(41)]

  1. package {
  2. import flash.display.*;
  3. import flash.events.*;
  4. import flash.text.*;
  5. import flash.utils.*;
  6. public class Main extends Sprite
  7. {
  8.     static private const _NUM_TIMES:uint = 1000000;
  9.     
  10.     private function _init():void
  11.     {
  12.         _debug(
  13.             "各テスト " + _NUM_TIMES + " 回処理させた計算結果 [単位 : ミリ秒]\n" +
  14.             "(誤差は多少生じます)\n"
  15.         );
  16.         
  17.         var n:uint = 10;
  18.         
  19.         _measure("ループのみ"function ():void
  20.         {
  21.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  22.                 
  23.             }
  24.         });
  25.         
  26.         _measure("1 回のみ比較する if ... else 文"function ():void
  27.         {
  28.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  29.                 if (n === 0) {}
  30.                 else {}
  31.             }
  32.         });
  33.         
  34.         _measure("1 回のみ比較する switch 文"function ():void
  35.         {
  36.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  37.                 switch (n) {
  38.                     case 0break;
  39.                     defaultbreak;
  40.                 }
  41.             }
  42.         });
  43.         
  44.         _measure("10 回比較する if ... else 文"function ():void
  45.         {
  46.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  47.                 if (n === 0) {}
  48.                 else if (n === 1) {}
  49.                 else if (n === 2) {}
  50.                 else if (n === 3) {}
  51.                 else if (n === 4) {}
  52.                 else if (n === 5) {}
  53.                 else if (n === 6) {}
  54.                 else if (n === 7) {}
  55.                 else if (n === 8) {}
  56.                 else if (n === 9) {}
  57.                 else {}
  58.             }
  59.         });
  60.         
  61.         _measure("10 回比較する switch 文"function ():void
  62.         {
  63.             for (var i:uint = 0; i < _NUM_TIMES; i++) {
  64.                 switch (n) {
  65.                     case 0break;
  66.                     case 1break;
  67.                     case 2break;
  68.                     case 3break;
  69.                     case 4break;
  70.                     case 5break;
  71.                     case 6break;
  72.                     case 7break;
  73.                     case 8break;
  74.                     case 9break;
  75.                     defaultbreak;
  76.                 }
  77.             }
  78.         });
  79.         
  80.         _debug("\n結果については言及しませんので, 各自ご判断ください.");
  81.     }
  82.     
  83.     private var _field:TextField;
  84.     private var _time:uint;
  85.     
  86.     public function Main():void
  87.     {
  88.         _setup();
  89.         _init();
  90.     }
  91.     
  92.     private function _measure(title:String, func:Function, ...params):void
  93.     {
  94.         _time = getTimer();
  95.         func.apply(null, params);
  96.         _time = getTimer() - _time;
  97.         
  98.         _debug("[ " + title + " ] --> " + _time + " ms");
  99.     }
  100.     
  101.     private function _debug(log:String):void
  102.     {
  103.         _field.appendText(log + "\n");
  104.     }
  105.     
  106.     private function _setup():void
  107.     {
  108.         _field = new TextField();
  109.         _field.width = stage.stageWidth - 40;
  110.         _field.height = stage.stageHeight - 60;
  111.         _field.x = 20;
  112.         _field.y = 60;
  113.         _field.multiline = true;
  114.         _field.wordWrap = true;
  115.         
  116.         var format:TextFormat = _field.defaultTextFormat;
  117.         format.font = "_sans";
  118.         _field.defaultTextFormat = format;
  119.         
  120.         addChild(_field);
  121.         
  122.         var button:Sprite = new Sprite();
  123.         button.graphics.lineStyle(1, 0xBBBBBB);
  124.         button.graphics.beginFill(0xEEEEEE);
  125.         button.graphics.drawRoundRect(001002055);
  126.         button.graphics.endFill();
  127.         
  128.         addChild(button);
  129.         
  130.         button.x = 20;
  131.         button.y = 20;
  132.         button.mouseChildren = false;
  133.         button.buttonMode = true;
  134.         
  135.         var field:TextField = new TextField();
  136.         field.width = 100;
  137.         field.height = 20;
  138.         field.htmlText = "<p align='center'><font face='_sans'>再計算</span></p>";
  139.         
  140.         button.addChild(field);
  141.         
  142.         button.addEventListener(MouseEvent.CLICK, function ():void
  143.         {
  144.             _field.text = "";
  145.             _init();
  146.         });
  147.     }
  148. }
  149. }
noswf
Get Adobe Flash Player