[AS3]Error: Error #2101: URLVariables.decode() に渡される文字列は、名前/値のペアを含む、URL エンコーディングされたクエリー文字列でなければなりません。 [まとめ]WEB制作に役立つチートシート日本語版9個+9個
12月 25

時間の処理には、trick7さんのTeraClockを使わせてもらいました。

キモは、

(TextArea).verticalScrollPosition = (TextArea).maxVerticalScrollPosition

だけです。

デバッグ用に、TextAreaに変数とかを表示させたいときに、スクロールバーが付いてこないと非常に見づらいので、上の1行を追加すると便利です。


Actionscript:
  1. package 
  2. {
  3.     import fl.controls.Button;
  4.     import fl.controls.TextArea;
  5.     import flash.display.MovieClip;
  6.     import flash.events.*;
  7.    
  8.     import com.trick7.utils.TeraClock
  9.     /**
  10.      * ...
  11.      * @author IRONHEARTS
  12.      */ 
  13.     public class Main extends MovieClip
  14.     {
  15.         private var _ta1:TextArea;
  16.         private var _ta2:TextArea;
  17.         private var _reset:Button;
  18.         private var _tc:TeraClock;
  19.  
  20.         public function Main():void
  21.         {
  22.             addEventListener(Event.ADDED_TO_STAGE, init);
  23.         }
  24.        
  25.         private function init(e:Event = null):void
  26.         {
  27.             removeEventListener(Event.ADDED_TO_STAGE, init);
  28.            
  29.             _ta1 = TextArea(getChildByName("ta1"));
  30.             _ta2 = TextArea(getChildByName("ta2"));
  31.             _reset = Button(getChildByName("reset"));
  32.            
  33.             _reset.addEventListener(MouseEvent.CLICK, resetHandler);
  34.            
  35.             _tc = new TeraClock;
  36.            
  37.             _tc.addEventListener(TeraClock.SECONDS_CHANGED, secListener);
  38.  
  39.         }      
  40.         private function resetHandler(e:MouseEvent):void
  41.         {
  42.             _ta1.text = _ta2.text = "";
  43.         }      
  44.         private function secListener(e:Event):void
  45.         {
  46.             var s:String = _tc.hours2 + ":" + _tc.minutes2 + ":" + _tc.seconds;
  47.            
  48.             _ta1.text += s + "\n";
  49.             _ta2.text += s + "\n";
  50.    
  51.             _ta2.verticalScrollPosition = _ta2.maxVerticalScrollPosition;
  52.         }
  53.     }
  54. }

ソース必要な人はドウゾつtascroll.fla,Main.as

Popularity: 7% [?]

written by ANN

add to hatena hatena.comment (2) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 2

Leave a Reply