Code:
import flash.external.*;
class SWFKit.Socket extends SWFKit.BaseObj
{
public function Socket()
{
super("Socket");
}
public static function fromID(id: Number)
{
var socket = new Socket;
socket.Release();
socket.Identifier = id;
return socket;
}
public function get error()
{
return ExternalInterface.call("ffish_getprop", this.Identifier, "error");
}
public function accept()
{
return ExternalInterface.call("ffish_call", this.Identifier, "accept");
}
public function asyncSelect(event)
{
return ExternalInterface.call("ffish_call", this.Identifier, "asyncSelect", event);
}
public function bind()
{
return ExternalInterface.call("ffish_call", this.Identifier, "bind", arguments);
}
public function close()
{
ExternalInterface.call("ffish_call", this.Identifier, "close")
}
public function connect(address, port)
{
return ExternalInterface.call("ffish_call", this.Identifier, "connect", address, port);
}
public function create()
{
return ExternalInterface.call("ffish_call", this.Identifier, "create", arguments);
}
public function getPeerName()
{
return ExternalInterface.call("ffish_call", this.Identifier, "getPeerName");
}
public function getSockName()
{
return ExternalInterface.call("ffish_call", this.Identifier, "getSockName");
}
public function getSockOpt(name, level)
{
return ExternalInterface.call("ffish_call", this.Identifier, "getSockOpt", name, level);
}
public function setSockOpt(name, value, level)
{
return ExternalInterface.call("ffish_call", this.Identifier, "setSockOpt", name, value, level);
}
public function ioctl()
{
return ExternalInterface.call("ffish_call", this.Identifier, "ioctl", arguments);
}
public function listen()
{
return ExternalInterface.call("ffish_call", this.Identifier, "listen", arguments);
}
public function receive()
{
return ExternalInterface.call("ffish_call", this.Identifier, "receive", arguments);
}
public function receiveFrom()
{
return ExternalInterface.call("ffish_call", this.Identifier, "receiveFrom", arguments);
}
public function send()
{
return ExternalInterface.call("ffish_call", this.Identifier, "send", arguments);
}
public function sendTo()
{
return ExternalInterface.call("ffish_call", this.Identifier, "sendTo", arguments);
}
public function shutDown()
{
return ExternalInterface.call("ffish_call", this.Identifier, "shutDown", arguments);
}
public function htonl(hostlong)
{
return ExternalInterface.call("ffish_call", this.Identifier, "htonl", hostlong);
}
public function htons(hostshort)
{
return ExternalInterface.call("ffish_call", this.Identifier, "htons", hostshort);
}
public function ntohl(netlong)
{
return ExternalInterface.call("ffish_call", this.Identifier, "ntohl", netlong);
}
public function ntohs(netshort)
{
return ExternalInterface.call("ffish_call", this.Identifier, "ntohs", netshort);
}
public function set onConnect(handler)
{
var handlerName = "_" + this.Identifier + "_onConnect";
ExternalInterface.addCallback(handlerName, this, handler);
ExternalInterface.call("ffish_seh", this.Identifier, "onConnect", handlerName);
}
public function set onClose(handler)
{
var handlerName = "_" + this.Identifier + "_onClose";
ExternalInterface.addCallback(handlerName, this, handler);
ExternalInterface.call("ffish_seh", this.Identifier, "onClose", handlerName);
}
public function set onReceive(handler)
{
var handlerName = "_" + this.Identifier + "_onReceive";
ExternalInterface.addCallback(handlerName, this, handler);
ExternalInterface.call("ffish_seh", this.Identifier, "onReceive", handlerName);
}
public function set onSend(handler)
{
var handlerName = "_" + this.Identifier + "_onSend";
ExternalInterface.addCallback(handlerName, this, handler);
ExternalInterface.call("ffish_seh", this.Identifier, "onSend", handlerName);
}
public function set onOOBData(handler)
{
var handlerName = "_" + this.Identifier + "_onOOBData";
ExternalInterface.addCallback(handlerName, this, handler);
ExternalInterface.call("ffish_seh", this.Identifier, "onOOBData", handlerName);
}
public function set onAccept(handler)
{
var handlerName = "_" + this.Identifier + "_onAccept";
ExternalInterface.addCallback(handlerName, this, handler);
ExternalInterface.call("ffish_seh", this.Identifier, "onAccept", handlerName);
}
}
but i'm don't send data to Socket...please help me...where bug...