0 Replies Latest reply on Nov 16, 2007 2:23 AM by sktib

    Calling play() on the videodisplay from JS doesn't do anything

    sktib
      Hello Folks,

      I have created a simple VideoDisplay where I can play a video file.

      I have setup the Flex-Ajax bridge so that when I click a button on the page, I can access the elapsed time using code as below

      var elapsedTime = flexApp.getInstructorWindow().getPlayheadTime();

      All this works fine. Now, instead of initiating the play from a button on the Flash window I want to do it from a button on the html page. I use that button to call a JS function as below which calls the ActionScript function startSync - same function that is called when the button the flash player is pressed (and that works).

      function startPlayBack(){
      alert('In startPlayBack');
      flexApp.getInstructorWindow().startSync();

      alert('Calling slideshow');
      slideShow();
      }

      I get the first alert message but not the second one and my video player doesn't play anything. The startSync ActionScript function is as below.

      public function startSync():void {
      Alert.show("test1", "test2");
      instructorWindow.source = videoFile;
      totalTimeArea.text = "";
      stopTimeArea.text = "";
      instructorWindow.play();
      // start_sync.send();
      }

      The videoFile variable is initialized when the VideoDisplay loads up using the code below

      videoFile = Application.application.parameters.videoFile;

      All this works fine when the button is pressed on the flash player but I can't get it to play with a call from JS from the web page. Any thoughts on what could be going wrong would be appreciated.

      I am on Win XP using FireFox 2.0.0.9 and Flash Player 9.

      Thanks much for any thoughts.

      Sanjay.

      BTW: instructorWindow is the id of my VideoDisplay as below
      <mx:VideoDisplay id="instructorWindow" width="291" height="264" x="6" y="7"/>