0 Replies Latest reply on Dec 22, 2009 12:13 PM by Hottie&Sizzle

    Select Video for player help

    Hottie&Sizzle

      I need help i am trying to create a video display with a list to select what video to play.

       

      Here is my code so far:

       

       

      <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
               paddingLeft="4" paddingRight="8" paddingBottom="4"
               horizontalScrollPolicy="off" verticalScrollPolicy="off">

       

          <mx:Script>
          <![CDATA[

       

              private function toggle():void
              {
                  if (vd.playing)
                  {
                      vd.stop();
                      list.visible = true;
                  }
                  else
                  {
                      list.visible = false;
                      vd.play();
                  }
              }

       

          ]]>
          </mx:Script>

       

          <mx:Parallel id="hideList">
              <mx:children>
                  <mx:Array>
                      <mx:Resize target="{list}" widthTo="0"/>
                      <mx:Resize target="{vd}" widthTo="400" heightTo="300"/>
                  </mx:Array>
              </mx:children>
          </mx:Parallel>

       

          <mx:Parallel id="showList">
              <mx:children>
                  <mx:Array>
                      <mx:Resize target="{list}" widthTo="180"/>
                      <mx:Resize target="{vd}" widthTo="240" heightTo="180"/>
                  </mx:Array>
              </mx:children>
          </mx:Parallel>

       

          <mx:List id="list" width="180" height="100%" selectedIndex="0"
                   hideEffect="hideList" showEffect="showList">
              <mx:dataProvider>
                  <mx:Array>
                      <mx:Object label="Applying the CompreSleeve"/>
                  </mx:Array>
                  <mx:Array>
                      <mx:Object label="Applying Strap Extenders"/>
                  </mx:Array>
              </mx:dataProvider>
          </mx:List>

       

          <mx:Canvas width="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off">

       

              <mx:VideoDisplay id="vd" width="320" height="240" source="assets/compresleeve.flv"
                               autoPlay="false" complete="list.visible=true"/>

       

              <mx:Button label="{vd.playing ? 'Stop' : 'Play'}" click="toggle()" left="8" bottom="8" includeInLayout="false">
              </mx:Button>

       

          </mx:Canvas>

       

      </mx:HBox>

       

       

      Now I just want to know how to get the item selected in the "list" to change to source of the video. Any help would be greatly appreciated!

       

      Thanks

       

      Ben Sir Noob alot