本人网上查找了很多资料,其中大部分都是关于Flash中的动画效果问题,与这里的问题关系型不太大。故把问题的解决方法写在这里,与人方便,与己方便。

方法一:

1.在自定义的widget中添加如下两个方法:

private function copyStyleFromParent(selector:String):void

{

var chartBaseStyle:CSSStyleDeclaration = styleManager.getStyleDeclaration(selector);

if (!chartBaseStyle && styleManager.parent)

{

var parentStyle:CSSStyleDeclaration = styleManager.parent.getStyleDeclaration(selector);

if (parentStyle)

{

styleManager.setStyleDeclaration(selector, parentStyle, false);

}

}

}

protected function preinitializeHandler ():void

{

var styleObjects:Array =new Array();//FlexGlobals.topLevelApplication.styleManager.selectors;

styleObjects.push( "mx.charts.chartClasses.ChartBase" );

styleObjects.push( "mx.charts.chartClasses.CartesianChart" );

styleObjects.push( "mx.charts.chartClasses.PolarChart" );

styleObjects.push( "mx.charts.BarChart");

styleObjects.push( "mx.charts.ColumnChart" );

styleObjects.push( "mx.charts.LineChart");

styleObjects.push( "mx.charts.PieChart");

styleObjects.push( "mx.charts.AxisRenderer" );

styleObjects.push( ".blockCategoryAxis");

styleObjects.push( ".blockNumericAxis");

styleObjects.push( ".linedNumericAxis");

styleObjects.push( ".dashedNumericAxis");

styleObjects.push( ".dashedCategoryAxis");

styleObjects.push( ".hangingCategoryAxis");

styleObjects.push( "mx.charts.GridLines");

styleObjects.push( ".horizontalGridLines");

styleObjects.push( "mx.charts.series.BarSeries" );

styleObjects.push( "mx.charts.series.ColumnSeries" );

styleObjects.push( "mx.charts.series.LineSeries" );

styleObjects.push( "mx.charts.series.PieSeries" );

for each(var styleObj:String in styleObjects) {

                             

copyStyleFromParent(styleObj);

}

}

  2.在该自定义widget头部中添加preinitialize="preinitializeHandler ()" 。

方法二:

在自定义widget中覆盖父类的moduleFactory方法:

  override public function get moduleFactory():IFlexModuleFactory {

    return FlexGlobals.topLevelApplication.moduleFactory;

  }

在自定义的widget中引入图表后,运行时出现TypeError #1009错误的更多相关文章

  1. 报错:此版本的SQL Server Data Tools与此计算机中安装的数据库运行时组件不兼容

    在Visual Studio 2012中使用Entity Framework,根据模型生成数据库时,报如下错误: 无法在自定义编辑器中打开Transact-SQL文件此版本的SQL Server Da ...

  2. c++ 程序编译后运行时的内存分配

    程序编译后运行时的内存分配 太好的文章了,看到不得不转,转自:http://blog.sina.com.cn/s/blog_5420e0000101a0w1.html 一.编译时与运行时的内存情况 1 ...

  3. 为什么一定要调用 setlocale 呢? 因为在 C/C++ 语言标准中定义了其运行时的字符集环境为 "C" ,也就是 ASCII 字符集的一个子集。使用setlocal改变整个应用程序的字符集编码方式(wcstombs使用前要设置 setlocale (LC_ALL, "chs"); )

    setlocale 配置地域化信息. 语法: string setlocale(string category, string locale); 返回值: 字符串 函数种类: 操作系统与环境   内容 ...

  4. ios 引入第三方库 运行时找不到函数实现

    今天引入webtrends 这个库,结果一直运行时找不到函数,纳闷了一下午! 后来发现,是other flag没有设置对,对于那些包含category用来扩展ios原始类型的库,链接的时候需要特别的链 ...

  5. 关于Java项目打包成Runnable jar文件后运行时图片不显示的问题

    现象:在eclipse中能够无误运行,但导出Runnable jar后运行jar包时不显示图片. 原因:路径问题. 方法1: 新建一个文件夹.文件夹中放那个jar包和image文件夹.在这种情况下,双 ...

  6. WP8.1中C++的winodws运行时组件位移操作的差异

    最近学习WP8.1应用开发,想把C语言的SM3国密算法移植到手机app中.由于把C语言的代码转换成C#代码工作量较大,因此只能用winodws运行时组件来实现. SM3国密算法是一种HASH算法,具体 ...

  7. Java中获取类的运行时结构

    获取运行时类的完整结构 通过反射获取运行时类的完整结构 Field(属性).Method(方法).Constructor(构造器).Superclass(父类).Interface(接口).Annot ...

  8. Springboot 项目中引入WebSocket后,单元测试出现错误

    报错信息 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test. ...

  9. 如何解决weblogic server启动中在IIOP后运行缓慢

    WebLogic Server在Linux环境中,有时因为linux OS的安全包没有安装,导致weblogic server 在启动的时候会在长时间的停留在 <2/07/2009 08:54: ...

随机推荐

  1. css transform 2D3D转换

    2D转换 translate 移动 <style> div{ width: 100px; height: 100px; } .box{ border: 1px dashed red; fl ...

  2. JS高级---案例:随机小方块 (贪吃蛇的食物部分)

    案例:随机小方块 产生随机数对象,自调用构造函数 产生小方块对象,自调用构造函数,里面存放: 食物的构造函数 给原型对象添加方法:初始化小方块的显示的效果及位置---显示地图上 给原型对象添加方法,产 ...

  3. redis安装与基本使用

    什么是Redis 什么是NoSQL 介绍Redis之前,先了解下NoSQL (Not noly SQL)不仅仅是SQL 属于非关系型数据库:Redis就属于非关系型数据库 传统的Mysql ,orac ...

  4. 吴裕雄 python 机器学习——主成份分析PCA降维

    # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from sklearn import datas ...

  5. python 第三方库安装

    1.首先安装pip 2.在cmd中找到pip的安装路径,(一般在python的scripts文件中) 3.pip install 第三方库名称

  6. VS2015生成代码图

    熟悉代码调用流程,可以在调试结束前显示代码图,操作位置: 比如开源的caffe_ocr的代码图:

  7. Dart语言学习(七)Dart Map类型

    映射(Maps)是无序的键值对: 常用属性: keys 获取所有的key值 values 获取所有的value值 isEmpty 是否为空 isNotEmpty 是否不为空 常用方法: remove( ...

  8. 手码两万余字,SpringMVC 包教包会

    1. SpringMVC 简介 1.1 Spring Web MVC是什么 Spring Web MVC 是一种基于 Java 的实现了 Web MVC 设计模式的请求驱动类型的轻量级 Web 框架, ...

  9. C:数组基础

    数组 在程序设计中,为了方便处理数据把具有相同类型的若干变量按有序形式组织起来--称为数组. 数组就是在内存中连续的相同类型的变量空间.同一个数组所有的成员都是相同的数据类型,同时所有的成员在内存中的 ...

  10. P1030 求先序排列 (一个非常棒的写法)

    理论正确就是真正的正确,误... 就是找嘛,找到每一个对应字符,然后对应的左右子树的区间,然后就可以了. #include <bits/stdc++.h> using namespace ...