Flash CS3 ドキュメンテーション |
|||
| ActionScript 2.0 リファレンスガイド > ActionScript クラス > TextField > maxscroll (TextField.maxscroll プロパティ) | |||
public maxscroll : Number (読み取り専用)
TextField.scroll の最大値を示します。
対応バージョン : ActionScript 1.0、Flash Player 6
次の例では、スクロールテキストフィールド my_txt の最大値を設定します。テキストフィールドをスクロールする 2 つのボタン、scrollUp_btn および scrollDown_btn を作成します。次の ActionScript を FLA ファイルまたは AS ファイルに追加します。
this.createTextField("scroll_txt", this.getNextHighestDepth(), 10, 10, 160, 20);
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 30, 320, 240);
my_txt.multiline = true;
my_txt.wordWrap = true;
for (var i = 0; i<10; i++) {
my_txt.text += "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh "
+ "euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.";
}
scrollUp_btn.onRelease = function() {
my_txt.scroll--;
scroll_txt.text = my_txt.scroll+" of "+my_txt.maxscroll;
};
scrollDown_btn.onRelease = function() {
my_txt.scroll++;
scroll_txt.text = my_txt.scroll+" of "+my_txt.maxscroll;
};
この例で使用している MovieClip.getNextHighestDepth() メソッドには Flash Player 7 以降が必要です。SWF ファイルにバージョン 2 のコンポーネントがある場合は、MovieClip.getNextHighestDepth() メソッドではなく、バージョン 2 のコンポーネントの DepthManager クラスを使用します。
このページに新しいコメントが追加された場合に、電子メールでの通知を希望する。 | コメントレポート
現在のページ: http://livedocs.adobe.com/flash/9.0_jp/main/00002216.html