XMLSocket and swf

Hi guys, I need a helping hand. I want to develop an XMLSocket flash file to use in a web chat and I am a complete n00b regarding Flash CS3. My question is:

Q: How to create such a file using Flash CS3, no movie at all, just the action script.

I already have some code in actionscript as follows:

import flash.net.XMLSocket;
import flash.external.ExternalInterface;

var socket;
function init(){
  socket = new XMLSocket();
  socket.onConnect = function(success){ ExternalInterface.call("socketopen",success); };
  socket.onClose = function(){ ExternalInterface.call("socketclose"); };
  socket.onError = function(msg){ ExternalInterface.call("socketerror",msg); };
  XMLSocket.prototype.onData = function(msg){ ExternalInterface.call("socketdata",msg); }
function connect(url,port){
function disconnect(){
function postMessage(msg){

ExternalInterface.addCallback("init", init); 
ExternalInterface.addCallback("connect", connect); 
ExternalInterface.addCallback("disconnect", disconnect); 
ExternalInterface.addCallback("postMessage", postMessage); 

As you can see, the socket.swf will be used embedded in an HTML page, events will be handled in javascript.

All the help you can provide will be greatly appreciated.

Again, all I need is a few steps on how to create a movieless actionscript in Flash CS3 to embed in an HTML page. Baby steps like, open CS3, hit F9, paste your code, change some settings, and presto.

Remember, I know nothing about CS3 (but I am no retard either), you’ll be my guide.

Thanks in advance.