Packagejp.naggg.effects
Classpublic class TypeWriter
InheritanceTypeWriter Inheritance flash.events.EventDispatcher

文字が一文字ずつ表示されるアニメーションクラス. RPGなどでテキストが表示されるエフェクトです. HTMLテキストの場合、その中のテキストでアニメーションを行い、 アニメーション完了時にHTMLテキストに変換を行います. 同様に、StyleSheet を設定されているテキストの付与には appendText() を基本使っていますが、 StyleSheet を適用したテキストには使えないので注意が必要で、 その場合、なるべく StyleSheet を使わないデフォルトの状態でも 表示に差異がないようにする必要があります. TODO イベント設定のところ

View the examples



Public Properties
 PropertyDefined By
  currentCharIndex : uint
[read-only] 現在アニメーションをしているテキストが何文字目かを返します.
TypeWriter
  interval : uint
アニメーション間隔(速度)、ミリ秒で指定します.
TypeWriter
  isPlaying : Boolean
[read-only] アニメーションしているかどうか.
TypeWriter
  numChars : uint
[read-only] 指定されたテキストが何文字かです.
TypeWriter
  useHTML : Boolean
[read-only] HTMLテキストを使うかどうかです. これは途中で変更することはできません.
TypeWriter
Public Methods
 MethodDefined By
  
TypeWriter(text:String, target:TextField, interval:uint = 20, useHTML:Boolean = false)
コンストラクタです.アニメーションの設定はすべてここで行います. また、アニメーション設定はここでしかできないので注意が必要です.
TypeWriter
  
pause():void
アニメーションを一時停止します.
TypeWriter
  
play():void
アニメーションを開始します. 現在アニメーションを行っている場合は無視します.
TypeWriter
  
skip():void
アニメーションをスキップして一気にすべてを表示します.
TypeWriter
  
stop():void
アニメーションを停止します.
TypeWriter
  
toString():String
[override] 文字列表現を返します.
TypeWriter
Property Detail
currentCharIndexproperty
currentCharIndex:uint  [read-only]

現在アニメーションをしているテキストが何文字目かを返します.


Implementation
    public function get currentCharIndex():uint
intervalproperty 
interval:uint

アニメーション間隔(速度)、ミリ秒で指定します.


Implementation
    public function get interval():uint
    public function set interval(value:uint):void
isPlayingproperty 
isPlaying:Boolean  [read-only]

アニメーションしているかどうか.


Implementation
    public function get isPlaying():Boolean
numCharsproperty 
numChars:uint  [read-only]

指定されたテキストが何文字かです.


Implementation
    public function get numChars():uint
useHTMLproperty 
useHTML:Boolean  [read-only]

HTMLテキストを使うかどうかです. これは途中で変更することはできません.


Implementation
    public function get useHTML():Boolean
Constructor Detail
TypeWriter()Constructor
public function TypeWriter(text:String, target:TextField, interval:uint = 20, useHTML:Boolean = false)

コンストラクタです.アニメーションの設定はすべてここで行います. また、アニメーション設定はここでしかできないので注意が必要です.

Parameters
text:String — 表示したい文字列です.HTMLテキストを指定することもできます.
 
target:TextField — テキストを表示する対象ダイナミックテキストフィールド.
 
interval:uint (default = 20) — アニメーション間隔(ミリ秒)、デフォルトでは 20 ミリ秒です.
 
useHTML:Boolean (default = false) — HTMLテキストを使用するかどうかのフラグです.
Method Detail
pause()method
public function pause():void

アニメーションを一時停止します.

play()method 
public function play():void

アニメーションを開始します. 現在アニメーションを行っている場合は無視します.

skip()method 
public function skip():void

アニメーションをスキップして一気にすべてを表示します.

stop()method 
public function stop():void

アニメーションを停止します.

toString()method 
override public function toString():String

文字列表現を返します.

Returns
String
Examples
 
     import jp.naggg.net.CacheBuster;
     var tw:TypeWriter = new TypeWriter("Hello world!!", myText_txt, 250);
     tw.onAnimationFinish = function(){
         // TODO ここに終了後の処理を記述
     }