
package
{
	import joju.World;
	import mx.controls.Alert;
	import mx.messaging.channels.*;
	import mx.rpc.events.*;
	import mx.rpc.remoting.mxml.*;
	import mx.rpc.Responder;

	public class Main
	{
		[Bindable]
    	public var world:World;

		private var m_ro:RemoteObject;
		private var m_ch:AMFChannel;

		public function Main( _ro:RemoteObject)
		{
			m_ro	= _ro;
			m_ro.getOperation( "hello" ).send( "yo" ).addResponder( new Responder( onHello, onFault ) );
 		}

		private function onHello( _event:ResultEvent ):void
		{
			Alert.show( String( _event.result ) );
		}

		private function onFault( _event:FaultEvent ):void
		{
			Alert.show( _event.fault.faultString );
		}


		public function setWorld( _world:World ):void
		{
			world = _world;
//			Alert.show( world.firstname );
		}

	}
}