Featured FLA
» Author: Nitin Tikhe
» Title: Cart
» Description: This Animation Tut is a fun and useful for kids below 15 years. Watch the Flag, Doors, Stick and Horse movements.
» More by Nitin Tikhe
Featured Site
» Posted in the Flash Kit Links section
» Title: Banana Swimwear
» Description: This is a banana swim wear interactive catalog we designed and animated in Flash
We start by creating an array for the labels and values and creating a new
instance of the DataProviderClass.
var arrLabel = new Array();
var arrValue = new Array();
var ChartData = new DataProviderClass();
We loop through each of the text fields and add their value to the labels and
values arrays. Then we add the information to the data provider and assign
field names of DataLabel and DataValue.
for (i=0; i < NumToUpdate; i++) {
arrLabel[i] = this["ChartLabel"+i].text;
arrValue[i] = this["ChartValue"+i].text;
ChartData.addItem({DataLabel:ArrLabel[i], DataValue:ArrValue[i]});
}
Finally, we link the data provider with the chart.