What does your code look like (the .addEventListener call and the definition of your listener)? -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com
-----Original Message----- From: netdeep <[EMAIL PROTECTED]> Reply-To: [email protected] To: [email protected] Subject: [flexcoders] Re: appending to a dataprovider in actionscript Date: Fri, 21 Nov 2008 15:18:35 -0000 Well, I tried this approach and while I didn't work, at least I finally got an error from flash instead of the whole program just hanging: TypeError: Error #1006: value is not a function. at mx.charts::DateTimeAxis/mapCache()[C:\Work\flex\dmv_automation \projects\datavisualisation\src\mx\charts\DateTimeAxis.as:1403] at mx.charts.series::LineSeries/updateMapping()[C:\Work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\series \LineSeries.as:1054] at mx.charts.chartClasses::Series/validateData()[C:\work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \Series.as:1600] at mx.charts.series::LineSeries/describeData()[C:\Work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\series \LineSeries.as:1174] at mx.charts.chartClasses::DataTransform/describeData()[C:\work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \DataTransform.as:234] at mx.charts.chartClasses::AxisBase/describeData()[C:\work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \AxisBase.as:177] at mx.charts.chartClasses::NumericAxis/get dataDescriptions()[C:\work\flex\dmv_automation\projects \datavisualisation\src\mx\charts\chartClasses\NumericAxis.as:1033] at mx.charts.chartClasses::NumericAxis/autoGenerate()[C:\work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \NumericAxis.as:1050] at mx.charts.chartClasses::NumericAxis/updateCache()[C:\work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \NumericAxis.as:761] at mx.charts.chartClasses::NumericAxis/update()[C:\work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \NumericAxis.as:884] at mx.charts.chartClasses::NumericAxis/getLabelEstimate()[C:\work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \NumericAxis.as:645] at mx.charts::AxisRenderer/measureLabels()[C:\Work\flex\dmv_automation \projects\datavisualisation\src\mx\charts\AxisRenderer.as:1740] at mx.charts::AxisRenderer/calcRotationAndSpacing()[C:\Work\flex \dmv_automation\projects\datavisualisation\src\mx\charts \AxisRenderer.as:1459] at mx.charts::AxisRenderer/adjustGutters()[C:\Work\flex\dmv_automation \projects\datavisualisation\src\mx\charts\AxisRenderer.as:1326] at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\Work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \CartesianChart.as:19 37] at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\Work\flex \dmv_automation\projects\datavisualisation\src\mx\charts\chartClasses \CartesianChart.as:13 55] at mx.core::UIComponent/validateDisplayList()[E:\dev\3.1.0\frameworks \projects\framework\src\mx\core\UIComponent.as:6293] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.1.0 \frameworks\projects\framework\src\mx\managers\LayoutManager.as:605] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.1.0 \frameworks\projects\framework\src\mx\managers\LayoutManager.as:678] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.1.0\frameworks \projects\framework\src\mx\core\UIComponent.as:8565] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.1.0\frameworks \projects\framework\src\mx\core\UIComponent.as:8508] --- In [email protected], Fu Di <[EMAIL PROTECTED]> wrote: > > if u want to listen a ArrayCollection when some of its elements are changed. u could write like this: > dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE,updateHandler); > private function updateHandler(event:CollectionEvent):void > { > > } > look up CollectionEvent api , u can find out how to do next step. > > > > > > ________________________________ > From: netdeep <[EMAIL PROTECTED]> > To: [email protected] > Sent: Friday, November 21, 2008 2:41:48 AM > Subject: [flexcoders] appending to a dataprovider in actionscript > > > I am still trying to iron out the problems with data binding in actionscript an server push. If I just replace the old > array with a new one, it updates ok, but when I append to an array, it doesn't seem to work. > > I have to do everything in actionscript. I set up the data binding like this. > > BindingUtils. bindProperty( lineSeries, "dataProvider" , ser, "pointList") ; > > Here is the way I'm currently trying to append the new data and catch the error, but this does not work. > > // oldArray is the same as pointlist from the data binding line of code above > for (var i:int = 0; i<newArray.length; i++) { > oldArray.addItem( newArray. getItemAt( i)); > } > > What's more, because the app is fired remotedly from a server process, I can't trace or run it in debug mode to find > out why it's failing. Usually, I'll throw in an Alert.show to find out if the data is messed up or a variable is null, but > when I do it after running this loop, the Alert just hangs the whole application. Is there anyway to throw an error to > a popup box (flash seems to do this from time to time on its own) > > And one final related question. If I do get the new arrays to work, will the charts labels and range adjust > accordingly. In other words, if the original array was from Mon-Wed, if the new data is on Thurs, will the chart auto > adjust properly to show the new data? >

