Tenev
Tenev

Reputation: 241

Byte in Actionscript 3? (from C++ to AS3)

how do i convert this C++ code to AS3

void myFunc(BYTE type)
{
//send type to the network server..
}

Upvotes: 0

Views: 1929

Answers (1)

Ilya Denisov
Ilya Denisov

Reputation: 878

There is no such type as BYTE in ActionScript 3 but you can use 'int' instead. It will looks something like this:

var socket:flash.net.Socket;
//...
function myFunc( type:int ):void {
  socket.writeByte( type );
}

As it said in Socket docs: "The low 8 bits of the value are used; the high 24 bits are ignored." So only 8 bits will be written to socket just like it is expected with BYTE in C++.

Upvotes: 2

Related Questions