<mx:Applicationxmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="genData()"> <mx:Script> <![CDATA[ privatevar DJIA:Number = Math.random()*50 - 20; privatevar NASDAC:Number = DJIA - Math.random() * 20; privatevar SP500:Number = Math.random()*40; publicfunction genData():void { // assigning the data that the chart is bound to // is best done via a local variable that is then // set to the chart data, rather than adding values to the // dataprovider of the chart var newArr:Array = []; for(var i:int = 0; i<10; i++) { DJIA = DJIA + Math.random()*10 - 5; NASDAC = NASDAC - Math.random() * 5; SP500 = Math.random()*40; newArr.push({"DJIA": DJIA, "NASDAC": NASDAC, "SP500": SP500 }); } chartData = newArr; } [Bindable] publicvar chartData:Array = [];