shred Object 간단 한 예

1768 단어 .netxmlFlashAdobe
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
	<mx:Script>
		<![CDATA[
			
			import flash.net.SharedObject;
			import mx.logging.Log;
			private var net:NetConnection;
			private var soChat:SharedObject;
		
			public function init():void{
				NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;
				SharedObject.defaultObjectEncoding  = flash.net.ObjectEncoding.AMF0;	
				net=new NetConnection();
				net.connect("rtmp://192.168.200.14/red");//    red5,/ red          
				
				addEvent();
			}
			public function addEvent(){
				net.addEventListener(NetStatusEvent.NET_STATUS,showError);
				soChat = SharedObject.getRemote( "videoConferenceChat", net.uri, true );
//				soChat.addEventListener( NetStatusEvent.NET_STATUS, netStatusHandler );
//				soChat.addEventListener( AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler );
//				soChat.addEventListener( SyncEvent.SYNC, sharedObjectSyncHandler );
				soChat.client = this;
				soChat.connect( net );
				soChat.send("getName"); //      ,           getName  
			}
			public function getName():void{
				trace("helloWorld")
			}
			public function send(){
				
			}
			public function showError(e:NetStatusEvent){
		
				trace(e.info.code=="NetConnection.Connect.Success");
				
			
				
			}
		]]>
	</mx:Script>
</mx:Application>

좋은 웹페이지 즐겨찾기