# How to add an eventListener to change the DATA Grid ID3 Info based on the mp3

**URL:** <https://forum.kirupa.com/t/how-to-add-an-eventlistener-to-change-the-data-grid-id3-info-based-on-the-mp3/76083>\
**Category:** flash\
**Created:** [January 14, 2005, 5:32pm UTC](https://forum.kirupa.com/t/how-to-add-an-eventlistener-to-change-the-data-grid-id3-info-based-on-the-mp3/76083 "2005-01-14T17:32:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imenstes](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@imenstes](https://forum.kirupa.com/u/imenstes)\
**Post date:** [January 14, 2005, 5:32pm UTC](https://forum.kirupa.com/t/how-to-add-an-eventlistener-to-change-the-data-grid-id3-info-based-on-the-mp3/76083/1 "2005-01-14T17:32:42Z")

</div>

Okay i am trying to load the ID3 tag information into a data grid. Now from the awsome documentation, i figured out how to make this happen. Now I want it to change when I load a new song. This is the AS i am using, can anyone help. I think that I need to add an even listener to listen for the change on mySound\_sound but not sure how to do this for it trigger the change on the data grid. Thanks.

```
                                                                                                                                                                                                                                                                                                                         Attach Code                                                                                      

```

import mx.controls.gridclasses.DataGridColumn;  
var id3\_dg:mx.controls.DataGrid;  
id3\_dg.move(0, 0);  
id3\_dg.setSize(900,200);  
var property\_dgc:DataGridColumn = id3\_dg.addColumn(new DataGridColumn(“property”));  
property\_dgc.width = 100;  
property\_dgc.headerText = “ID3 Property”;  
var value\_dgc:DataGridColumn = id3\_dg.addColumn(new DataGridColumn(“value”));  
value\_dgc.width = id3\_dg.\_width-property\_dgc.width;  
value\_dgc.headerText = “ID3 Value”;  
var mySound\_sound:Sound = new Sound();  
mySound\_sound.onID3 = function() {  
trace(“onID3 called at “+getTimer()+” ms.”);  
for (var prop in this.id3) {  
id3\_dg.addItem({property:prop, value:this.id3[prop]});  
}  
};  
mySound\_sound.loadSound(“snakeeater.mp3”, true);  
controls\_mc.play\_btn.onRelease = function() {  
stopAllSounds();  
mySound\_sound.start(mySound\_sound.position/1000, 9999);  
};  
controls\_mc.stop\_btn.onRelease = function() {  
mySound\_sound.stop();  
};  
controls\_mc.load\_btn.onRelease = function() {  
mySound\_sound.loadSound(“maintheme.mp3”, false);  
}
