Posted on 2010-01-26 14:13
S.l.e!ep.¢% 阅读(650)
评论(0) 编辑 收藏 引用 所属分类:
A·M·F·3
public function appInit():void
{
import flash.utils.ByteArray;
//writing to ByteArray
var byteObj:ByteArray = new ByteArray();
//write an Array to ByteArray as AMF3
byteObj.writeObject( new Array( "Hello", 2, 3, 4, 5 ) );
trace( byteObj.length )
//write a String to ByteArray as AMF3
byteObj.writeObject( "Hello Write Byte World" );
// reading ByteArray
byteObj.position = 0
//read an Array from ByteArray AMF3
trace( byteObj.readObject() );
//read a String from ByteArray AMF3
trace( byteObj.readObject() );
}