Trouble with flash and arduino?

So I'm trying to use flash to send small "commands" to my arduino over usb serial I have my arduino code set up but i can't seem to get any response once I press my button in flash. I'm using serproxy and the flash connects but after that I'm stuck.
here is my arduino code.

const int ledPin = 13; 
int incomingByte; 
int m = 0;
int ledState = LOW; 

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  if (Serial.available() > 0) {
    incomingByte = Serial.read();
    if (incomingByte == '1') {
      m = 1;
    } 
    if (incomingByte == '2') {
      m = 2;
    }
    if (incomingByte == '3') {
      m = 3;
    }
    if (incomingByte == '4') {
      m = 0;
    }
    if (incomingByte == 'p') {
      Serial.println(m);
    }  
  }
  switch (m) {
  case 1:
    digitalWrite(ledPin, HIGH);
    delay(100);
    break;
  case 2:
    if (ledState == LOW)
      ledState = HIGH;
    else
      ledState = LOW;

    digitalWrite(ledPin, ledState);
    delay(100);
    break;
  case 3:
    digitalWrite(ledPin, HIGH);
    delay(10);
    digitalWrite(ledPin, LOW);
    delay(100);
    break;
  default:
    digitalWrite(ledPin, LOW);
   break; 
  }
}

And my Action Script 3 code.

import flash.net.Socket;

var mySocket = new Socket

mySocket.connect("127.0.0.1", 5331)

if (mySocket.connected){
var sym:SimpleButton;

sym.addEventListener(MouseEvent.MOUSE_DOWN, symbtn);
function symbtn(event:MouseEvent):void {
   mySocket.writeBytes(1);
}
}

Have you gotten your arduino code to work with the serial monitor? If not, then that would be a place to start trouble shooting.

Oh yes sorry I forgot to mention it but yes it does work with serial monitor.

I'm not sure why you are using writeBytes(), which writes an array of bytes, to write a single value. Why not use the writeByte() method, instead?
[edit]
The flash application is connecting to port 5331. What do you have connecting that port to the serial port that the Arduino is listening to?[/edit]

I did use writeByte but after hours of frustration I was trying everything just to be sure.

Ok I just realized I left out that I'm using serproxy to connect flash to the arduino and yes the flash application connects to serproxy fine. I just can't figure out why the data that's sent out isn't getting to the arduino.

Is it safe to assume that you have read this page?
http://www.arduino.cc/playground/Interfacing/Flash

Yes I have and I know i could use firmata and as3dlue or what ever but I am avoiding having to re write my code to work for that just because I like the challenge but I can't find any help.

just because I like the challenge

I can certainly understand that. But, if you can't get it to work, you might try using as3glue and firmata, just to verify that it is not hardware or permissions issue.

Once you know that the hardware works, and that you have all the right permissions to open sockets and connect the ports, then go back to the non-as3glue approach.

I guess I will. Thanks for the help.