fc2ブログ

ByteArray (2)

2008/07/26 23:41 - AS3.0






ブール値の write、read に関わるメソッド

writeBoolean(value:Boolean):void



readBoolean():Boolean





(1)
var ba:ByteArray = new ByteArray();
ba.writeBoolean(true);
ba.writeBoolean(true);
ba.writeBoolean(false);
ba.writeBoolean(true);
ba.writeBoolean(false);
trace("position:", ba.position, " length:", ba.length);

(2)
trace("\nreadBoolean()");
var len:uint = ba.length;
ba.position = 0;
while (ba.position < len){
 trace(ba.position, ":", ba.readBoolean());
}

(3)
trace("\n[]access");
for (var i:uint = 0; i < len; i++){
 trace("ByteArray[",i,"] :", ba[i]);
}

(1)
position: 5  length: 5

(2)
readBoolean()
0 : true
1 : true
2 : false
3 : true
4 : false

(3)
[]access
ByteArray[ 0 ] : 1
ByteArray[ 1 ] : 1
ByteArray[ 2 ] : 0
ByteArray[ 3 ] : 1
ByteArray[ 4 ] : 0




にほんブログ村 IT技術ブログへ


スポンサーサイト




コメントの投稿

非公開コメント

タグクラウド

最近の記事
カテゴリ
月別アーカイブ
プロフィール

Aquioux

Author:Aquioux
日曜 Flash プログラマ。
Flash 作品は本館で展示しています。


mailto:aquioux@mail.goo.ne.jp

ブログパーツ

あわせて読みたい

フィードメーター - 閃光的網站・弛緩複合体 -Review Division-


検索/translation
Google



オススメ本

コメント
トラックバック
RSS

Add to Google

Bloglinesで閲読登録

はてなRSSに追加

Subscribe with livedoor Reader

My Yahoo!に追加

Add to Technorati Favorites!

feedpathに追加