# Select Next Item in Datagrid

**URL:** <https://forum.kirupa.com/t/select-next-item-in-datagrid/266020>\
**Category:** flash\
**Created:** [July 15, 2008, 4:09pm UTC](https://forum.kirupa.com/t/select-next-item-in-datagrid/266020 "2008-07-15T16:09:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fcbastiat](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fcbastiat](https://forum.kirupa.com/u/fcbastiat)\
**Post date:** [July 15, 2008, 4:09pm UTC](https://forum.kirupa.com/t/select-next-item-in-datagrid/266020/1 "2008-07-15T16:09:57Z")

</div>

Is it possible to change the focus in the Datagrid through ActionScript? Right now, I have a Datagrid with a list of external .flv’s. When the user selects one, the video begins playing. I would like to create a “next” and “last” button that will change focus on the Datagrid and play the video. Here is what I currently have to play a selected video.

```php
function cellPress(evt_obj:Object) {
    var item = mydgrid.selectedItem;
    tt( mydgrid.selectedItem.name);
    var fName = mydgrid.selectedItem.name
    playMovie(fName);
};

function playMovie(what) {
    this.videoContainer._width = vidWidth;
    this.videoContainer._height = vidHeight;
    stopVideo();
    initNetStream();
    
    ns.setBufferTime(5);
    this.videoContainer.attachVideo(this.ns);
    ns.play(what);
}

```

How can I adapt this to make a playNextMovie function? Thanks for your help. I look forward to your suggestions.
