2 Replies Latest reply: Apr 6, 2012 12:09 PM by rmenard3 RSS

    Dynamic Publishing

    rmenard3 Community Member

      I seem to have struck a wall with my current project and would appreciate any insight I can get to be put towards the right direction. I will try to explain my scenario in the best way that I can, however, if I fail to do so in some areas, let me know and I will do my best to reiterate. Here goes...

       

      I am trying to push a dynamic variable into the publish method of the NetStream class. The variable is instantiated dynamically and is called in the ActionScript source. To test fluidity and correctiveness of the instantiation and parsing of said variable, I call it to a text field. The text field displays the information derived, as it should. However, when I try to call the said variable into the publish method of the NetStream class, nothing appears to happen on the server end of FMS aside from a randomly generated name and a status of "idle". When I turn the variable into a static variable, it parses fine and publishes on to the server, however the dynamic way of going about it is bringing me to a wall. I hope to have explained this in a way thats understandable and will provide more if needed. Any ideas would be amazing.

        • 1. Re: Dynamic Publishing
          SE_0208 Adobe Employee

          I am not still not clear what exactly you are trying to do. Is it possible to post the code snippet and explain what is your use case?

          • 2. Re: Dynamic Publishing
            rmenard3 Community Member

            myXML = new XML(e.target.data);

                var userOne:String = myXML.session.user1[0];

                aT.text = userOne;

               

                var userTwo:String = myXML.session.user2[0];

             

                ////////////////////////////////////////////

               

                //connect to the Flash Media Server

                var client_nc:NetConnection = new NetConnection();

                client_nc.connect("XXXADDRESSXXX");

                var cam_ns:NetStream = new NetStream(client_nc);

               

                cam_ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

               

                function netStatusHandler(event:NetStatusEvent):void

                {

                    switch (event.info.code)

                    {

                        case "NetConnection.Connect.Success":

                        //attach our camera video and audio to the net stream

                        cam_ns.attachCamera(mycam);

                        cam_ns.attachAudio(mycam_audio);

                       

                        //publish to our Flash Media Server as a

                        //live stream called user_1

                        cam_ns.publish(userOne, "live");

                       

                        //bring in user_2's video/audio

                        var in_ns:NetStream = new NetStream(client_nc);

                        in_ns.play(userTwo);

                       

                        //attach user_1's published audio and video

                        //so we can see them in the larger chat window

                        live_feed.source = "XXXADDRESSXXX" + userTwo;

                        //live_feed.attachAudio(in_ns);

                       

                        cam_feed.source = "XXXADDRESSXXX" + userOne;

                        //cam_feed.attachAudio(mycam_audio);

                       

                        break;

                    }

                }

            I am trying to push the data called from the XML into a stream as the name