2 Replies Latest reply on Dec 17, 2009 2:24 PM by Miroooooooooooooo

    Problem With Media playback component in flash

    Miroooooooooooooo

      Hello ,

       

      I'm new using flash component , I'm trying to make some images and when I click on the image I have to  play an external flv file

       

      I have created an instance of media playback component and set it's instance name = player

      the code of the image on(release)

       

      {

           player.contentPath = "name.flv";

           player.play()

      }

       

      but it doesn't work , so i want to know what is the problem please

       

      thanks in advance

        • 1. Re: Problem With Media playback component in flash
          RossRitchey Level 4

          Does it load the FLV, but not play it? Is that the problem you are having?

           

          If so, its because you are telling it to play before it has anything.  Loading an FLV is an asynchronous process, and other code will execute while it happens.

           

          The best method for this is to set the autoPlay to true.

           

          player.autoPlay = true;

           

          If it isn't loading the FLV at all - put a trace in the mouse handler to make sure that the function is firing.

           

          on(release)
               trace("Should be loading the video");
               player.contentPath = "name.flv";
          }
          

           

          And test it in Flash.  If the click handler is firing, then the trace will appear in the output panel.  If it is, and the FLV isn't loading, check that the path is correct. (You will see an error in the output panel as well if the FLV doesn't load)

          • 2. Re: Problem With Media playback component in flash
            Miroooooooooooooo Level 1

            Thank you very much

             

            I solved itby adding the name of the movie that will run in global variable

            and on (release) i set it's value that i have read from the XML file

            and on the media playback load event

            player.contentPath = _global.myVar;

            and it's work

             

            Thank you very much for your reply