ArgumentError: Error #1063: the number of parameters for BasicChart/dataFunc () does not match. There should be two, currently three .,
1. Error description
ArgumentError: Error #1063: the number of parameters for BasicChart/dataFunc () does not match. There should be 2, currently 3. At mx. charts. chartClasses: Series/cachedefavaluvalues () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ Series. as: 1260] at mx. charts. series: LineSeries/updateData () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ series \ LineSeries. as: 1188] at mx. charts. chartClasses: Series/validateData () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ Series. as: 1950] at mx. charts. series: LineSeries/describeData () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ series \ LineSeries. as: 1273] at mx. charts. chartClasses: DataTransform/describeData () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ DataTransform. as: 282] at mx. charts. chartClasses: AxisBase/describeData () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ AxisBase. as: 238] at mx. charts. chartClasses: NumericAxis/get dataDescriptions () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ NumericAxis. as: 1264] at mx. charts. chartClasses: NumericAxis/autoGenerate () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ NumericAxis. as: 1281] at mx. charts. chartClasses: NumericAxis/updateCache () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ NumericAxis. as: 974] at mx. charts. chartClasses: NumericAxis/update () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ NumericAxis. as: 1108] at mx. charts. chartClasses: NumericAxis/getLabelEstimate () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ NumericAxis. as: 833] at mx. charts: AxisRenderer/measureLabels () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ AxisRenderer. as: 2056] at mx. charts: AxisRenderer/calcRotationAndSpacing () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ AxisRenderer. as: 1701] at mx. charts: AxisRenderer/adjustGutters () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ AxisRenderer. as: 1565] at mx. charts. chartClasses: CartesianChart/updateAxisLayout () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ CartesianChart. as: 2182] at mx. charts. chartClasses: CartesianChart/updateDisplayList () [E: \ dev \ 4.0.0 \ frameworks \ projects \ datavisualization \ src \ mx \ charts \ chartClasses \ CartesianChart. as: 1391] at mx. core: UIComponent/validateDisplayList () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ core \ UIComponent. as: 8531] at mx. managers: LayoutManager/validateDisplayList () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ managers \ LayoutManager. as: 663] at mx. managers: LayoutManager/doPhasedInstantiation () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ managers \ LayoutManager. as: 718] at mx. managers: LayoutManager/doPhasedInstantiationCallback () [E: \ dev \ 4.0.0 \ frameworks \ projects \ framework \ src \ mx \ managers \ LayoutManager. as: 1072]
2. Error cause
<? Xml version = "1.0" encoding = "UTF-8"?> <S: Application xmlns: fx = "http://ns.adobe.com/mxml/2009" xmlns: s = "library: // ns.adobe.com/flex/spark" xmlns: mx = "library: // ns.adobe.com/flex/mx "width =" 100% "height =" 100% "fontSize =" 12 "fontFamily =" "> <s: layout> <s: basicLayout/> </s: layout> <fx: Script> <! [CDATA [import mx. charts. chartItem; import mx. charts. chartClasses. series; import mx. charts. series. items. lineSeriesItem; import mx. collections. arrayCollection; import mx. events. flexEvent; import mx. graphics. stroke; [Bindable] // bind line chart data to private var lineArray: ArrayCollection = new ArrayCollection ([{seasons: "Spring", rate: "0.48677" },{ seasons: "Summer", rate: "0.122343232" },{ seasons: "Autumn", rate: "0.5657645" },{ seasons: "Winter", rate: "0.67484889"}]);/*** set the number of digits in the line chart ratio */public function myDataFunction (series: Series, item: Object, fieldName: String ): object {var temp: Number = item. rate; var number: String = formatter. format (temp); return number;} public function myFillFunction (item: ChartItem, index: Number): String {var curItem: LineSeriesItem = LineSeriesItem (item); var num: string = formatter. format (curItem. yNumber); return num;} public function myFilterFunction (item: Object): String {var temp: Number = item. rate; var number: String = formatter. format (temp); return number;} public function myDataFunction1 (series: Series, item: Object, fieldName: String): Object {if (fieldName = 'yvalue ') return (formatter. format (item. rate); else if (fieldName = "xValue") return (formatter. format (item. seasons); elsereturn null;} private function dataFunc (series: LineSeries, item: Object): Object {var df: NumberFormatter = new NumberFormatter (); df. precision = "2"; df. rounding = "up"; return df. format (item. rate);}]> </fx: Script> <fx: Declarations> <mx: numberFormatter id = "formatter" precision = "2" rounding = "up"/> </fx: Declarations> <mx: VBox width = "100%" height = "100%" paddingBottom = "10" paddingLeft = "10" paddingRight = "15" paddingTop = "10" horizontalAlign = "center"> <mx: lineChart id = "line" width = "100%" height = "90%" dataProvider = "{lineArray}" showDataTips = "true"> <mx: horizontalAxis> <mx: categoryAxis categoryField = "seasons" displayName = ""/> </mx: horizontalAxis> <mx: horizontalAxisRenderers> <mx: axisRenderer placement = "bottom" tickLength = "1" tickStroke = "{new Stroke (0xFF0000, 1)}" axisStroke = "{new Stroke (0xFF0000, 1 )} "> <mx: axis> <mx: LinearAxis id =" bottomAxis "/> </mx: axis> </mx: AxisRenderer> </mx: horizontalAxisRenderers> <mx: verticalAxisRenderers> <mx: AxisRenderer placement = "left" tickLength = "1" tickStroke = "{new Stroke (0xFF0000, 1)}" axisStroke = "{new Stroke (0xFF0000, 1)} "> <mx: axis> <mx: LinearAxis id =" leftAxis "/> </mx: axis> </mx: AxisRenderer> </mx: verticalAxisRenderers> <mx: series> <mx: lineSeries verticalAxis = "{leftAxis}" displayName = "ratio" xField = "seasons" yField = "rate" dataFunction = "dataFunc"/> </mx: series> <mx: filters> <fx: Array/> </mx: filters> </mx: LineChart> <mx: Legend dataProvider = "{line}"/> </mx: VBox> </s: Application>
3. Solution
As3 sound pause and playback: ArgumentError: Error #2068: Invalid sound
You don't need to use new one more time. After sound = new Sound, the sound will be re-initialized. Therefore, an error will be reported after your parameters are passed in. You should just add new on the top, do not use new in this function.
ArgumentError: Error #2108: Introduction to Ancient Poetry not found
Bytes