I need a little help...I'm pretty new to AS3 and would greatly appreciate any help or guidance!
So, I have dataGrid that is pulling data from an XML file. How do I make each data row clickable and load 1 of 3 SWF's (depending which you pick) onto the stage.
Actionscript Code:
import fl.controls.dataGridClasses.DataGridColumn;
import fl.data.DataProvider;
import fl.containers.UILoader;
import fl.data.DataProvider;
import fl.events.*;
import flash.xml.*;
var myXML:XML;
var myList:XMLList;
function parseXML():void
{
var url:String = "myData.xml";
var urlRequest:URLRequest = new URLRequest(url);
var loader:URLLoader = new URLLoader();
loader.addEventListener("complete" , loadXML);
loader.load(urlRequest);
}
parseXML();
function loadXML(evt:Event):void
{
myXML = new XML(evt.target.data);
myDP = new DataProvider(myXML);
myData.dataProvider = myDP;
// DataGrid Columns defined
var yearCol:DataGridColumn = new DataGridColumn("year");
yearCol.headerText = "Year";
yearCol.width = 50;
var makeCol:DataGridColumn = new DataGridColumn("make");
makeCol.headerText = "Make";
makeCol.width = 125;
var modelCol:DataGridColumn = new DataGridColumn("model");
modelCol.headerText = "Model";
modelCol.width = 175;
var typeCol:DataGridColumn = new DataGridColumn("type");
typeCol.headerText = "Body Type";
typeCol.width = 225;
var myDP:DataProvider;
myData.columns = [yearCol, makeCol, modelCol, typeCol]; // DataGrid column Array
myData.width = 600;
myData.dataProvider = myDP;
myData.rowCount = myData.length;
}