Module load control charts the emergence of Flex Error #1009 solution

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
It took me three hours to solve the problem of publishing.
When doing ColumnChart, found there are abnormal:
1009 - Error #1009: Cannot access a property or method of a null object reference.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.charts.chartClasses::ChartBase/initStyles()
at mx.charts.chartClasses::ChartBase/set moduleFactory()
at mx.charts.chartClasses::CartesianChart/set moduleFactory()
at mx.charts::ColumnChart/set moduleFactory()

It appears this problem for a long time only to find that only contains the control charts in the module, the ChartBase source code is found 1862 mistakes(sdk4.6),
var chartBaseStyle:CSSStyleDeclaration = styleManager.getStyleDeclaration("mx.charts.chartClasses.ChartBase");
ChartBaseStyle is empty.
This solution is, in the main program module (the MXML Module) are covered in:
override public function get moduleFactory():IFlexModuleFactory {
     return FlexGlobals.topLevelApplication.moduleFactory;
}


In addition, if the main application modules loaded in the chart chart DataTip color display problem, need in the main application (the application contains ModuleLoader) pre loading using Chart class, such as LineChart:
private var temp:LineChart=null;//Pre loading a class linechart, solve chart DataTip display color flex4bug
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Magee at January 03, 2014 - 1:30 PM