Posted on 2010-01-26 14:13
S.l.e!ep.¢% 閱讀(714)
評論(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() );
??
?? }