Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-2006, 10:41 AM
Member
 
Join Date: Jul 2006
Posts: 33
Default class SWFKit.Socket in Flash;

Hi, i'm write the class SWFKit.Socket:
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...
Reply With Quote
  #2 (permalink)  
Old 08-18-2006, 07:18 AM
Member
 
Join Date: Jul 2006
Posts: 33
Default Re:class SWFKit.Socket in Flash;

Who that in general hears me?! Help me PLEASE! :'(
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:48 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.