0 Replies Latest reply on Apr 17, 2007 8:02 AM by Rotzlucky

    Progress Bar for Video

    Rotzlucky
      Hey,
      I'm new to Flex and ActionScript and I have little Problem implementing a ProgressBar for an Video.
      It just doesn't work, no matter what i try!
      Here is some of the Code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application
      xmlns:mx=" http://www.adobe.com/2006/mxml"
      layout="vertical"
      width="100%"
      height="100%" creationComplete="init()">
      <mx:Panel
      width="100%"
      height="100%"
      layout="vertical"
      id="p"
      title="Videofenster">
      <mx:VideoDisplay
      width="100%"
      height="100%"
      id="vid"
      source="guitar.flv"
      autoPlay="false"/>
      <mx:Canvas
      width="100%"
      height="79">
      <mx:Button
      id="playButton"
      click="vid.play()"
      label="Play"
      x="192"
      y="10"/>
      <mx:ProgressBar
      x="389"
      y="10"
      label=""
      id="progress"
      mode="manual"
      minimum="0"
      maximum="100"/>
      <mx:Script>
      <![CDATA[
      import mx.events.VideoEvent;
      private function init():void
      {
      this.addEventListener(VideoEvent, showProgress);
      }
      private function showProgress(event:Event):void{
      progress.setProgress(vid.playheadTime, vid.totalTime);
      }
      ]]>
      </mx:Script>
      </mx:Canvas>
      </mx:Panel>
      </mx:Application>

      It looks like the method showProgress is never called, meaning the VideoEvent didn't raise. How is this possible, where is my fault? Any suggestions?
      I worked around this Problem, with a Button calling the sameMethod. This brings me to the next problem. Although, i can call the method by the Button, the progressBar ist still not acting!

      Every help is appreciated! Text