0 Replies Latest reply on Feb 16, 2010 4:46 AM by sreejithkh

    Error while loading video using AIR2 Beta

    sreejithkh

      The following sample code works fine with AIR 1.5 but throws a CONNECTION_ERROR when AIR2 beta is used.
      Please give your suggestions/solutions regarding the same.

       

      Code:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Script>
              <![CDATA[
                  import mx.controls.Alert;
                  import mx.events.VideoEvent;

       

                  private function videoDisplay_stateChange(evt:VideoEvent):void {
                      switch (evt.state) {
                          case VideoEvent.CONNECTION_ERROR:
                              evt.currentTarget.visible = false;
                              Alert.show(evt.currentTarget.source, "Unable to connect to video");
                              break;
                      }
                  }
              ]]>
          </mx:Script>
          <mx:VideoDisplay id="videoDisplay"
                  source="http://192.168.70.61/Videos/video33.flv"
                  stateChange="videoDisplay_stateChange(event);" autoPlay="false"/>
      </mx:WindowedApplication>