# Load xml video on tilelist click

**URL:** https://forum.kirupa.com/t/load-xml-video-on-tilelist-click/270553
**Category:** Uncategorized
**Created:** [September 10, 2008, 10:47pm UTC](https://forum.kirupa.com/t/load-xml-video-on-tilelist-click/270553 "2008-09-10T22:47:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![urbanrevolution](https://avatars.discourse-cdn.com/v4/letter/u/c89c15/32.png) [@urbanrevolution](https://forum.kirupa.com/u/urbanrevolution)
#### Post date: [September 10, 2008, 10:47pm UTC](https://forum.kirupa.com/t/load-xml-video-on-tilelist-click/270553/1 "2008-09-10T22:47:32Z")

</div>

greetings all,  
so i’m still working on the &#$@ player i 've added the TileList component from the Dynamic Playlist lesson at adobe… I have it working for he most part.  
i’m having some issues with playing the correct video on tileList click…  
i can get it to play continuously with the idx++  
but i can’t get it to play the clip i want on click  
(it just goes to the next video on any click)

vidoe player is “not” the FLplayback comp…

any help you can offer would be grand… thanks:cowboy:

[http://dev2.creativenet.net/\_n8/playlist/](http://dev2.creativenet.net/_n8/playlist/)

```auto
//////////////////load xml  
  var thumb:String;
 
   for (var i=0; i<playlist.vid.length(); i++) {
    if(playlist.vid*.hasOwnProperty("@thumb")>0) thumb = playlist.vid*.@thumb;
         vid_select.addItem({label:playlist.vid*.@desc, data:playlist.vid*.@src , source:thumb});
   }
//////////////////load xml END
//////////////////////////////////////vid_select highlight start
    vid_select.addEventListener(Event.CHANGE, clickit);
    vid_select.selectedIndex = 0;
  }
//////////////////////////////////////vid_select highlight start END
//////////////////////////////////////TileList Click
  function clickit(e:Event) {
      trace("selected" + e.target.selectedIndex);
   ns.play(e.target.selectedItem.data); 
   playSelectVideo();
   vid_select.selectedIndex = idx;
  }
//////////////////////////////////////TileList Click END
////////Retrieve the current video from the playlist XML object.
  function getVideo():String {
   return videosXML[idx].@src;
  }
/////////////Play the currently selected video.
  function playVideo():void {
   var src:String = getVideo();
   ns.play(src);
   trace ("play video"); 
/////////////Increase the current video index and begin playback of the video.
   vid_select.selectedIndex = idx++;
  }
 //////////////play video when tileList selected
  function playSelectVideo() {
   if (idx < (videosXML.length() - 1)) {
    trace("play move i choose");
 
    playVideo();
    vid.clear();

```
