• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Module Chart component Error #1009: Cannot access a property or method of a null object reference

Guest
May 31, 2013 May 31, 2013

Copy link to clipboard

Copied

Is there a known bug when displaying a chart component that is defined in a module. When attempting to display a chart component defined in a module it crashes indicating Error #1009: Cannot access a property or method of a null object reference.

It crashes at the following location in ChartBase.as. Somehow when loading the chart the  styleManager.getStyleDeclaration("mx.charts.chartClasses.ChartBase"); returns null so when using the setStyle methods the exception occurs.

 

private function initStyles():Boolean

    {

        HaloDefaults.init(styleManager);

 

  var chartBaseStyle:CSSStyleDeclaration = styleManager.getStyleDeclaration("mx.charts.chartClasses.ChartBase");

  chartBaseStyle.setStyle("chartSeriesStyles", HaloDefaults.chartBaseChartSeriesStyles);

  chartBaseStyle.setStyle("fill", new SolidColor(0xFFFFFF, 0));

  chartBaseStyle.setStyle("calloutStroke", new SolidColorStroke(0x888888,2));

 

        return true;

    }

Added note: There is a chart component in the application that works fine.  The only way I can get  the chart in the module to display is to add the following workaround preinitializer but it severly impacts the loading of the module. Is there a way around this.

protected function preinitializeHandler(event:FlexEvent):void
 
{     
   var styleObjects:Array = FlexGlobals.topLevelApplication.styleManager.selectors;
  
   for each(var styleObj:String in styleObjects)  {
   
    var style:CSSStyleDeclaration = FlexGlobals.topLevelApplication.styleManager.getStyleDeclaration(styleObj);
   
    styleManager.setStyleDeclaration(styleObj, style, true);   
   }

}

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::PolarChart/set moduleFactory()

at mx.charts::PieChart/set moduleFactory()

at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()

at spark.components::Group/addElementAt()

at spark.components::SkinnableContainer/addElementAt()

at mx.states::AddItems/addItemsToContentHolder()

at mx.states::AddItems/apply()

at mx.core::UIComponent/applyState()

at mx.core::UIComponent/commitCurrentState()

at mx.core::UIComponent/setCurrentState()

at mx.core::UIComponent/set currentState()

at BloodPressure/bloodpressureDg_selectionChangeHandler()

at BloodPressure/__bloodpressureDg_selectionChange()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at mx.core::UIComponent/dispatchEvent()

at spark.components::DataGrid/commitInteractiveSelection()

at spark.components::DataGrid/setSelectionAnchorCaret()

at spark.components::DataGrid/grid_mouseDownHandler()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at mx.core::UIComponent/dispatchEvent()

at spark.components::Grid/dispatchGridEvent()

at spark.components::Grid/grid_mouseDownDragUpHandler()

at Function/<anonymous>()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at mx.managers::SystemManager/mouseEventHandler()

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 31, 2013 May 31, 2013

Copy link to clipboard

Copied

LATEST

It appears as though this error has been going on for a while. See the following link http://forums.adobe.com/thread/941849

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines