Connecting to socks server

Alright im trying to connect to my friends socks server he has set up just to see if i can send something. The code below is an .as file and then my .fla file has import Name;

I did this because i was getting the nesting error and people said that is how you fix it. Well after doing that it publishes ok and everything but my info never gets sent to my friends server. His server is up and running so that is not the problem.


class Test {

    static var;

    static function onConnect(e) {
        sock.writeUTFBytes("Hello world
    static function main() {
        trace("Creating socket");

        sock = new;
        sock.addEventListener(, onConnect);
        try {
            sock.connect("", xxxx);
            trace("is connected? " + sock.connected);
        } catch (e:Dynamic) {
            trace("Error in connect: " + Std.string(e));

I have read the FAQ and went through 3 pages of AS3 forums before posting this. Im going mad here trying to figure it out. Please if you have any tips or suggestions feel free to post them.