3 Replies Latest reply on Feb 17, 2010 3:47 PM by redteardrop

    Flash builder video list.

    redteardrop

      I am trying to use the flash builder 4 beta to build a new website interface.  I currently have a flash player with a video playlist on the side. the player looks in an xml file and chooses a video in a list there.

      How can I do this with flashbuilder?

      video player of flv files (got that) and have a dynamic list on the side of video files to change the source video to play the new one.

      thanks

      Dylan

        • 1. Re: Flash builder video list.
          rfrishbe Level 3

          You should be able to use the VideoPlayer or the VideoDisplay (might be called VideoElement in FlashBuilder beta 2) to display the video.  You can set the source to be your .flv file, like:

           

          <s:VideoPlayer source="myVideo.flv" />

           

          So based on what the user selects, you can set the source of the video object.

           

          Hope that helps,

          Ryan

          1 person found this helpful
          • 2. Re: Flash builder video list.
            redteardrop Level 1

            I already had that part done. I need to be able to add buttons on the side to change the source of  a prebuilt videoplayer. I would assume the videoplayer would need an id and the buttons would change the source location of the id in the function.

            Similar to this example:

             

             

            <?xml version="1.0"?>

            <s:Application

             

             

            xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo">

             

             

             

            <fx:Script>

            <![CDATA[

             

             

            import flash.events.Event;

             

            private function video1a(event:Event):void {

             

            //change video to source 1 here ;

            }

             

             

            protected function video2a(event:Event):void{

             

            //change video to source 2 here ;

            }

             

            ]]>

             

             

            </fx:Script>

             

             

             

            <s:Button label="Batton" click="video1a(event);" x="258" y="35"/>

             

            <s:Button label="Button" click="video2a(event);" x="237" y="82" />

             

            <s:VideoPlayer x="123" y="257" width="510" height="299" click="printMessage(event);"/>

             

            </s:Application>

            • 3. Re: Flash builder video list.
              redteardrop Level 1

              Nevermind, I figured it out. Here is the code in case anyone wants it.

              Create a video player, add your buttons, then use this code as an example of how to get it to work.

               

               

               

              <?xml version="1.0"?>

              <s:Application

               

               

              xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo">

               

               

               

              <fx:Script>

              <![CDATA[

               

               

              import flash.events.Event;

               

              private function video1a(event:Event):void {

               

              //change video source 1 here ;

              thx.source=

               

              "file:///L|/video/t1.flv"

              }

               

               

              protected function video2a(event:Event):void{

               

              //change video source 2 here ;

              thx.source=

               

              "file:///L|/video/t2.flv"

              }

               

              ]]>

               

               

              </fx:Script>

               

               

               

              <s:Button label="Batton" click="video1a(event);" x="664" y="311"/>

               

               

              <s:Button label="Button" click="video2a(event);" x="664" y="268" />

               

               

              <s:VideoPlayer x="123" y="257" width="510" height="299" id="thx"/>

               

               

              <mx:Image x="511" y="82" source="file:///D|/Store/2009-Products-cards2.jpg" width="165" height="105" click="video1a(event);"/>

               

              </s:Application>