Sockets, buttons and eventlisteners

hi all!

i have added a socket to an actionscript class, added buttons to the flash application and eventlisters to the buttons.

i want to find out whether commands could be fired to the flash application from a remote application and as such have the remote applications button linked to the flash button which would execute when the remote button sends a command which would be listened to by the button.

thanx
korkor5