Unable to create Shared object In mxml file
===

I am trying to create a white board in my project which will be acting as an interaction between the two users.The way to show the exact replica of one screen to other can be done using Remote shared object.

I am trying to create a test application ,for creating a remote shared object and test the working, as i am a newbie in this.

But its providing me a headache as simply creating an object of Shared Object is giving me error.I have tried all sorts of research works and all,but no use.Can anyone help me regarding that.

Here is my code: -

   

     // ActionScript file
    import flash.events.*;
    import flash.net.*;
    
    import mx.events.FlexEvent;
    
    private var nc				:NetConnection;
    private var so				:SharedObject;
    
    private function applicationComplete(event:FlexEvent):void
    {
    	
    	nc = new NetConnection();
    	nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    	nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    	nc.connect("rtmp://localhost");
    	
    	so = SharedObject.getRemote("message", nc.uri, false);
    	so.client	= this;
    	so.connect(nc);
    	
    	sendBtn.addEventListener(MouseEvent.CLICK, onClickSendBtn);
    }
    
    private function onClickSendBtn(event:MouseEvent):void
    {
    	nc.call("sendMessage", null, messageTf.text);
    }
    
    public function receiveMessage(mesg:String):void
    {
    	outputTf.text += mesg+"\n";
    }
    
    private function netStatusHandler(event:NetStatusEvent):void 
    {
    	outputTf.text += "netStatusHandler \n";
    	
    	for ( var prop:String in event.info)
    	{
    		outputTf.text += "prop : "+prop+" = "+event.info[prop]+"\n";
    	}
    	
    	outputTf.text += event.info.code+"\n\n";
    }
    
    private function securityErrorHandler(event:SecurityErrorEvent):void 
    {
    	outputTf.text += "securityErrorHandler \n";
    
    	for (var prop:String in event) 
    	{
    		outputTf.text += "prop "+prop+" = "+event[prop]+"\n";
    	}
    	outputTf.text += "\n";
    }
        
    
    
    
    
    


And here is the error which i am getting while trying to build the code.

 

       E:\Project\shared.as(18):  Error: Call to a possibly undefined method getRemote through a reference with static type Class.
    
    	so = SharedObject.getRemote("message", nc.uri, false);
    
    E:\Project\shared.as(19):  Error: Access of possibly undefined property client through a reference with static type SharedObject.
    
    	so.client	= this;
    
    E:\Project\shared.as(20):  Error: Call to a possibly undefined method connect through a reference with static type SharedObject.
    
    	so.connect(nc);

Can anyone point me to the direction where i am keeping the wrong syntax.And also please tell me if there is any good way of creating the remote shared object .I am using Eclipse Helios for building the project.

