如何抑制 Flash 迁移警告 (1090) [英] How to suppress Flash migration warnings (1090)

查看:31
本文介绍了如何抑制 Flash 迁移警告 (1090)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Flash Professional CS4 中,当我使用鼠标/键盘输入处理程序名称(例如 onMouseDown、onKeyUp 等)时,我收到迁移问题"警告,即使我为它们添加了事件侦听器.这些名称对于函数来说是完全合法的,但由于它们是在 ActionScript 2.0 中自动触发的,因此我们现在(尽管很明智)警告说,它们在 AS3 中不再自动使用.

In Flash Professional CS4, I get "migration issue" warnings when I use mouse/keyboard input handler names such as onMouseDown, onKeyUp, etc., even though I have added event listeners for them. These names are perfectly legal for functions, but since these were automatically fired in ActionScript 2.0, we are now (albeit sensibly) warned that their use is no longer automatic in AS3.

我理解警告的目的,但它们对我没有用.我想抑制这些警告,但抑制任何其他警告,我通常确实发现这些警告很有用.

I understand the purpose of the warnings, but they aren't useful for me. I want to suppress these warnings, but without suppressing any other warnings, which I generally do find useful.

例如,当我使用这样的代码时:

E.g., when I use code like this:

/** @constructor */
public function MyClass() {
  addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}

protected function onMouseDown(e:MouseEvent):void {

我收到这样一个烦人的警告:

I get an annoying warning like this:

警告:1090:迁移问题:在 ActionScript 3.0 中,Flash Player 在运行时不会自动触发 onMouseDown 事件处理程序.您必须首先使用 addEventListener ( 'mouseDown', callback_handler) 为事件注册此处理程序.

有 flex 编译器 (mxmlc) 标志(和 Flash Pro 设置)可以抑制动作警告或所有警告,但我不想要那样.那太笼统了.

There are flex compiler (mxmlc) flags (and a Flash Pro setting) which can suppress actionscript warnings, or all warnings, but I don't want that. That's too general.

理想情况下,我可以抑制特定的错误/警告编号(警告 #1090).

Ideally I could suppress a specific error/warning number (Warning #1090).

编辑:我发现更多带有 mxmlc -help advanced 的高级"编译器标志,看起来很有希望.具体来说,以下似乎是可能的候选人:
warn-deprecated-event-handler-error
warn-deprecated-function-error
warn-deprecated-property-error

Edit: I've found more "advanced" compiler flags with mxmlc -help advanced, which look promising. Specifically, the following seem like likely candidates:
warn-deprecated-event-handler-error
warn-deprecated-function-error
warn-deprecated-property-error

如何让 Flash 使用这些?

How do I get Flash to use these?

编辑 2:我在 Flash 用户数据目录中找到了一个 flex-info.xml 样式的文档.
[userdatafolder]/Adobe/Flash CS4/en/Configuration/ActionScript 3.0/FlexInfo.xml然而,这个文件包含一个令人失望的注释:<!-- Flash 不支持大多数 flex-config 选项.-->,并且即使在重新启动 flash 后似乎也没有响应我的指令.
越来越难过了.

Edit 2: I found a flex-info.xml style document in the Flash User Data dir.
[userdatafolder]/Adobe/Flash CS4/en/Configuration/ActionScript 3.0/FlexInfo.xml However, this file contains a disappointing comment: <!-- Flash does not support most flex-config options. -->, and doesn't seem to respond to my directives even after restarting flash.
This is getting sad.

编辑 3:发现一个问题错误、烦人Adobe 错误跟踪器上的迁移问题"警告".Flex SDK 已确认修复,但未提及 Flash...

Edit 3: Found an issue "Erroneous, annoying "Migration issue" warnings" on Adobe bug tracker. A fix is confirmed for the Flex SDK, but no mention of Flash...

推荐答案

如果您在 $Flash/$LOCALE/Configuration/Actionscript 3.0/EnabledWarnings.xml 中编辑 EnabledWarnings.xml,您可以,其中 $Flash 是应用程序/程序文件文件夹中 Flash 的路径,$LOCALE 是您的语言.

You can if you edit EnabledWarnings.xml in $Flash/$LOCALE/Configuration/Actionscript 3.0/EnabledWarnings.xml, where $Flash is the path to Flash inside your Applications/Program Files folder and $LOCALE is your language.

例如

/Applications/Adobe Flash CS4/en/Configuration/ActionScript 3.0/EnabledWarnings.xml

您需要编辑第 29 行,将 enabled 属性设置为 false 以用于 warning id 1090:

You will need to edit line 29, setting the enabled attribute to false for warning with id 1090:

<warning id="1090" enabled="false"  label="kWarning_DepricatedEventHandlerError">EventHandler was not added as a listener.</warning>

<小时>

快速旁注:

Flash Builder (CS4)"是一个令人困惑的术语.在 Flex Builder 3 之后,Flex Builder 更名为 Flash Builder,没有 Flash Builder CS4.常规的 Flash IDE 被称为 Flash Professional/Flash Professional CS4,这是为了避免名称相似的产品之间的混淆:Flash Catalyst、Flash Builder(原为 Flex Builder)、Flash Professional.显然它并不总是那么好:)

"Flash Builder (CS4)" is a confusing term. After Flex Builder 3, Flex Builder got renamed to Flash Builder, there is no Flash Builder CS4. The regular Flash IDE is known as Flash Professional/Flash Professional CS4, this was to avoid confusion between products with similar names: Flash Catalyst, Flash Builder(was Flex Builder), Flash Professional. Obviously it doesn't always work that great :)

这篇关于如何抑制 Flash 迁移警告 (1090)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆