A have a map with more small pieces of lands, and I have a DataGrind where is the names of the which land, I need when to select the name of land the respective piece of land to colorize in the some color.
business_dg.vScrollPolicy = “auto”;
DGlistener = new Object();
//function when pressing on a cell in datagrids
DGlistener.cellPress = function(evt){
if(evt.target==business_dg){
var nr:Number = evt.itemIndex
var st:String = evt.target.selectedIndex
//This trace command is only for offline testing
//it is not ment for online testing
trace (“You selected “+business_ds.items[st].griditem+” which is number “+business_ds.items[nr].pkGrid);
//code below displays the selection in Dynamic text field
//This has been put to help you figure out how to detect what is selected.
trace_click.htmlText = “You selected <b>”+data_grid.items[st].griditem+”</b> which is number <b>”+data_grid.items[nr].pkGrid+"</b>";
_root.details_mc.company_txt.text = business_ds.items[st].Homesite_List;
_root.details_mc.address_txt.text = “”;//business_ds.items[st].HomeNumb;
_root.details_mc.tel_txt.text = business_ds.items[st].Telephone;
_root.details_mc.website_txt.text = “<a href=”"+business_ds.items[st].Website+"" target="_blank">"+business_ds.items[st].Website+"</a>";
_root.details_mc.email_txt.text = “<a href=“mailto:”+business_ds.items[st].Email+”">"+business_ds.items[st].Email+"</a>";
_root.details_mc.picture_img.load(“images/”+business_ds.items[st].Picture);
_root.details_mc.details_txt.text = business_ds.items[st].Details;
this.updateData(0)
}
}
//Setup which event to listen
business_dg.addEventListener(“cellPress”, DGlistener); //Press on datagrid
//This line turns off the coloum sorting
business_dg.sortableColumns = false;
stop();