1 Reply Latest reply on May 30, 2008 5:25 PM by Gregory Lafrance

    Please help me to play this .flv

    Shelady Level 1
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#ffffff" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#000000, #000000]">




      <mx:Script>
      <![CDATA[
      import flash.net.URLLoader;
      import flash.net.URLRequest;
      import flash.events.MouseEvent;
      import flash.events.Event;
      public function launch1(event:MouseEvent):void

      {
      myVid.addEventListener(MouseEvent.CLICK, playMovie);
      }

      public function playMovie():void
      {
      myVid.play();
      }


      ]]>
      </mx:Script>



      <mx:VideoDisplay id="myVid" height="270" width="290" source="MachineDefrag.flv"
      autoPlay="false" buttonMode="true" useHandCursor="true" click="launch1(event)"/>



      </mx:Application>
        • 1. Re: Please help me to play this .flv
          Gregory Lafrance Level 6
          The following code should work. When you specify the "click" event in the VideoDisplay tag, you don't need to add an event listener manually.

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
          layout="absolute" backgroundColor="#ffffff"
          backgroundGradientAlphas="[1.0, 1.0]"
          backgroundGradientColors="[#000000, #000000]">
          <mx:Script>
          <![CDATA[
          public function launch1():void {
          myVid.play();
          }
          ]]>
          </mx:Script>

          <mx:VideoDisplay id="myVid" height="270" width="290" source="MachineDefrag.flv"
          autoPlay="false" buttonMode="true" useHandCursor="true" click="launch1()"/>
          </mx:Application>