Reputation: 241
how do i convert this C++ code to AS3
void myFunc(BYTE type)
{
//send type to the network server..
}
Upvotes: 0
Views: 1929
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