2 Replies Latest reply on Aug 17, 2009 6:46 AM by sirk214

    Can hear audio but not see video

    bubbleboy21

      I have created a netconnection, netstream, and video but i can only hear the audio, not the video. I know it isn't the video file because i can see it in another video player. It is an flv, and i know it is something with my script. Which is below.

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]" width="468" height="390" initialize="startup()" >
          <mx:Script>
              <![CDATA[
                  private function startup():void {
                      var nc:NetConnection = new NetConnection();
                      nc.connect(null);
                      var ns:NetStream = new NetStream(nc);
                      ns.play("../Assets/Video/me.flv");
                      var vid:Video = new Video();
                      vid.attachNetStream(ns);
                      addChild(vid);
                  }
              ]]>
          </mx:Script>
      </mx:Application>

        • 1. Re: Can hear audio but not see video
          kkc_mca Level 2

          You cant directly add the video object to the stage

           

          to add it on the stage add UIComponent to stage and add the video object to it

           

          <?xml version="1.0" encoding="utf-8"?>

          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]" width="468" height="390" initialize="startup()" >

              <mx:Script>

                  <![CDATA[

                      private function startup():void {

                          var nc:NetConnection = new NetConnection();

                          nc.connect(null);

                          var ns:NetStream = new NetStream(nc);

                          ns.play("../Assets/Video/me.flv");

                          var vid:Video = new Video();

                          vid.attachNetStream(ns);

                         display.addChild(vid);

                      }

                  ]]>

              </mx:Script>

             <mx:UIComponent id="display"/>

          </mx:Application>

           

          if this reply answers or helps the question, please mark as such

          • 2. Re: Can hear audio but not see video
            sirk214 Level 1

            Be sure that you set display.visible = true ..This once cost me an hour of my life!