I recently set up Red5 on a hosted server and have been having trouble accessing Red5 from Flex.
Background ---------------------- 1) Let's say my server name is www.myserver.com 2) I am able to access http://www.myserver.com:5080/demos/ofla_demo.swf and connect to the server using the address rtmp://www.myserver.com/oflaDemo 3) I am using the Flex Builder 2 and am referencing Red5 actionscript files from http://www.vadus.de/uni/red5/AS_red5_Connection.zip 4) When I try to connect to the server from the mxml file listed below, I keep receiving a connection closed message Any ideas why this is happening? MXML File ------------------- <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();"> <mx:Script><![CDATA[ import org.red5.as3.net.Connection; import org.red5.as3.net.events.ConnectionEvent; private var conn:Connection; public function init():void { conn = new Connection(); // add a listener for a successful connection... conn.addEventListener(Connection.SUCCESS, handleSucessfulConnection); // add a listener for no successful connection... conn.addEventListener(Connection.DISCONNECTED, handleDisconnection); } public function connect():void { if(cmdConnect.label == "Connect") { conn.setURI(txtConnectURL.text); conn.connect(); cmdConnect.label = "Disconnect"; } else { conn.close(); cmdConnect.label = "Connect"; } } public function handleSucessfulConnection(e:ConnectionEvent):void { output.text += "\nConnection successful!"; } public function handleDisconnection(e:ConnectionEvent):void { output.text += "\nConnection to " + txtConnectURL.text + " closed."; } ]]> </mx:Script> <mx:TextInput id="txtConnectURL" width="200" height="22" text="rtmp://www.myserver.com/demo"/> <mx:TextArea id="output" width="400" height="400" textAlign="center" /> <mx:Button id="cmdConnect" label="Connect" click="connect();"/> </mx:Application>
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
