【问题标题】:ArgumentError: Error #2005: Parameter 0 is of the incorrect type. Should be type FilterArgumentError:错误 #2005:参数 0 的类型不正确。应该是类型过滤器
【发布时间】:2011-12-27 11:53:10
【问题描述】:

而且我的代码真的很简单:

date = new StyleableTextField();
date.filters = [new DropShadowFilter(1,90,0xffffff)];

怎么了?这太疯狂了

好的,我认为这需要更多信息: 我在项目渲染器中执行此操作(扩展 LabelItemRenderer)。方法是覆盖受保护的函数 createChildren():void

也许我以后必须调用设置过滤器?

【问题讨论】:

  • 导入 flash.filters.DropShadowFilter;而不是导入 spark.filters.DropShadowFilter;这解决了它

标签: apache-flex filter actionscript flex-spark


【解决方案1】:

ropo 是对的

这也发生在我身上。

我首先将 GlowFilter 应用于需要 spark.filters.GlowFilter 的 UIComponent

然后我更改了代码并应用于需要 flash.filters.GlowFilter 的 Sprite

由于 GlowFilter 已经导入,FlashBuilder 没有抛出任何编译错误,但它在运行时抛出了错误。

所以只要确定是否将过滤器应用到 Flex 组件然后导入

  spark.filters.*

对于非弹性体

  flash.filters.*

另外,如果有人想对 flex 和 flash 组件应用过滤器,请使用完全限定名称

  flexComp.filters = [new spark.filters.DropShadowFilter(1,90,0xffffff)];
  flashComp.filters = [new flash.filters.DropShadowFilter(1,90,0xffffff)];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-05
    • 2019-10-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多