I have been playing around with two Flex applications. One has been written by Brian http://flash-communications.net/technotes/fms2/flex2FMS/index.html <http://flash-communications.net/technotes/fms2/flex2FMS/index.html> and the other one is by Christophe Coenraets http://coenraets.com/viewarticle.jsp?articleId=98 <http://coenraets.com/viewarticle.jsp?articleId=98>
Brian's example works fine for me but Christophe's example gave me problems. I have sort of merged the two apps and have narrowed the problem down to one line of code: nsPublish = new NetStream(nc); When I run this line I see the following in the FMS2 console: Dropping application (flexvideo/_definst_) message. Clients not allowed to broadcast message. I can't figure out why this occurs, especially since Brian's app is very similar. Here's my complete MXML code. All you need on the FMS side is an app 'flexvideo' - no server side code is needed. Note: some of the vars decalred here aren't actualy used. Can you shed any light on this problem? Stefan <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" applicationComplete="init()"> <mx:Script> <![CDATA[ private var nc:NetConnection; private var camera:Camera; private var microphone:Microphone; private var nsPublish:NetStream; private var nsPlay:NetStream; private var localVid:Video; private var videoFMS:Video; private function init():void { nc = new NetConnection(); nc.connect("rtmp:/flexvideo"); nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus); nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, netSecurityError); } private function netStatus(event:NetStatusEvent):void { // Write out information about connection events: writeln("netStatus: " + event); var info:Object = event.info; for(var p:String in info) { writeln(p + " : " + info[p]); } writeln(""); // Change the application state if we connect or disconnect. switch(info.code) { case "NetConnection.Connect.Success": // Close and recreate streams if (nsPublish != null) nsPublish.close(); //if (nsPlay != null) nsPlay.close(); //nsPublish = new NetStream(nc); //nsPlay = new NetStream(nc); break; case "NetConnection.Connect.Closed": break; } } /** * Reports a security violation error after trying to connect. */ private function netSecurityError(event:SecurityErrorEvent):void { writeln("netSecurityError: " + event); } private function startStream():void { camera = Camera.getCamera(); camera.setMode(160, 120, 6, true); microphone = Microphone.getMicrophone(); localVid = new Video(160, 120); localVid.attachCamera(camera); var videoHolder:UIComponent = new UIComponent(); videoHolder.setActualSize(320, 120); videoHolder.addChild(localVid); outpanel.addChild(videoHolder); localVid.x = 0; localVid.y = 0; // THIS LINE CAUSES THE ERROR nsPublish = new NetStream(nc); } public function writeln(msg:String):void{ traceArea.text += msg + "\n"; traceArea.validateNow(); } ]]> </mx:Script> <mx:Panel title="Local WebCam" id="outpanel"> <mx:ControlBar> <mx:Button label="Start Stream" click="startStream()"/> </mx:ControlBar> </mx:Panel> <mx:TextArea width="486" height="217" id="traceArea"/> </mx:Application> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

