从 Flash CS 5 导入 SWC 时 Flex Builder 3 中出现自动化错误

发布于 2024-10-21 21:17:45 字数 1285 浏览 2 评论 0原文

我在尝试使用从 Flash CS5 导入的“swc”文件时遇到了一个非常奇怪的问题,我试图在 Flex Builder 3 中使用该文件(通过将符号转换为“Flex 组件”)。这些错误出现在与我正在导入的“swc”文件没有远程关系的文件中。

现在,我知道自动化功能已成为 FB4 的一部分,但我实际上没有迁移到 FB4 的选项。

我尝试更改 Flash CS5 中的 flex sdk 设置(步骤如下),但这没有帮助。 编辑-->首选项-->Actionscript-->“Actionscript 3.0设置”-->“Flex SDK路径”(将其指向flex3.5 sdk而不是Flex4.0 sdk)

我觉得问题是最有可能是 Flex 3 和 Flex 4 之间的兼容性问题,但尚未找到解决方法。非常感谢任何帮助。

谢谢, 卡皮尔

这是跟踪:

Severity and Description    Path    Resource    Location    Creation Time   Id
1044: Interface method createAutomationIDPartWithRequiredProperties in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.view.ui:SchematicWindow.
1044: Interface method createAutomationIDPartWithRequiredProperties in namespace mx.automation:IAutomationObject not implemented by class 
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.lib.controls:CloseableTabBar.    
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class 
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.lib.layouts:DockedAppLayout. 

I am facing a really weird issue while trying to use an "swc" file imported from Flash CS5, that I am trying to use in Flex Builder 3 (by converting symbol to "Flex Component"). The errors are coming in files which are not even remotely related to the "swc" file that i am importing.

Now, I know that the automation stuff has come as a part of FB4, but I don't really have an option to migrate to FB4.

I have tried to change the flex sdk settings in Flash CS5 (steps given below), but that has not helped.
Edit-->Preferences-->Actionscript-->"Actionscript 3.0 Settings"-->"Flex SDK Path" (pointing this to flex3.5 sdk instead of Flex4.0 sdk)

I feel that the issue is most probably a compatibility issue b/w Flex 3 and Flex 4, but have not been able to find a workaround for the same. Any help is greatly appreciated.

Thanks,
Kapil

Here is the trace:

Severity and Description    Path    Resource    Location    Creation Time   Id
1044: Interface method createAutomationIDPartWithRequiredProperties in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.view.ui:SchematicWindow.
1044: Interface method createAutomationIDPartWithRequiredProperties in namespace mx.automation:IAutomationObject not implemented by class 
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.lib.controls:CloseableTabBar.    
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class 
1044: Interface method get automationEnabled in namespace mx.automation:IAutomationObject not implemented by class com.sparsha.lib.layouts:DockedAppLayout. 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

祁梦 2024-10-28 21:17:46

好的,首先是错误:这意味着 Flash 可能为您使用某个模板导入的符号生成了一个类,而该模板不适合您用于编译项目的 SDK。具体来说,生成的类没有实现错误消息中列出的方法。即你的framework.swc有一个mx.automation:IAutomationObject的定义,它有方法createAutomationIDPartWithRequiredProperties()(顺便说一句,名字不错),但Flash生成的代码读作既然

package com.sparsha.view.ui {
import mx.automation:IAutomationObject;
public class SchematicWindow implements IAutomationObject { . . . } }

你不能对Flash做任何事情,不生成你需要的方法,你唯一的方法就是给SDK打monkeypatch。即,将 mx/automation/IAutomationObject.as 从 SDK 源复制到项目的类路径。删除冲突的方法声明(这可能会也可能不会导致其他错误)。如果它导致进一步的错误,请对每个“行为不当”的类重复相同的过程...

但是,monkeypatching 将意味着您不再能够使用框架 RSL,因为它们将随原始版本一起提供。因此,我会尝试完全避免这个问题,并寻找另一种从 Flash IDE 导出符号的方法,例如,不将它们设为 Flex 组件。或者,如果您确实坚持将它们作为 Flex 组件,则可以引导 FlexSprite,例如,并将您的 Flash 符号指定为引导类作为“父类”。

OK, first, the error: this means that Flash probably generated a class for the symbol you are importing using a certain template, where the template doesn't fit the SDK you are using to compile the project. Specifically, the generated class did not implement the methods listed in the error message. I.e. your framework.swc has a definition of mx.automation:IAutomationObject that has method createAutomationIDPartWithRequiredProperties() (nice name btw), but Flash generated code that reads as

package com.sparsha.view.ui {
import mx.automation:IAutomationObject;
public class SchematicWindow implements IAutomationObject { . . . } }

Since you cannot do anything about Flash not generating the method you need, your only way is to monkeypatch the SDK. I.e. copy the mx/automation/IAutomationObject.as from the SDK sources to the classpath of your project. Remove the conflicting method declaration (this may or may not result in other errors). If it results in further errors, repeat the same procedure for every class that "misbehaves"...

However, monkeypatching will mean that you are no longer able to use framework RSLs, as they will come with the original version. So, I would try to avoid the problem altogether and look for another way of exporting symbols from Flash IDE, for example, by not making them a Flex component. Or, if you really insist on them being a Flex component, then bootstrap the FlexSprite, for example, and assign your Flash symbols the bootstrapped class as the "parent class".

此刻的回忆 2024-10-28 21:17:46

我最近也遇到这个问题。当我将 flash 生成的 SWC 包含在我的 Flex 项目 lib 文件夹中时,我会收到错误。

我可以通过将 Flex 升级到 Flex 4.5.1.21328A SDK 来解决这个问题。

有关我的项目的其他详细信息可能对其他人有帮助:
我的 SWC 是从 Flash Professional CS5.5 生成的,我的 Flex 项目在 Flash Builder 4.5 中使用。

我的 SWC 已通过 ActionScript 3.0 发布到 Flash Player 9。
我的 Flex 项目使用的是 3.5.0.12683 SDK。

I was also having this problem recently. I would get the errors when I included the flash generated swc in my flex projects lib folder.

I was able to work around the issue by upgrading my flex to the flex 4.5.1.21328A SDK.

Additional Details about my project that might help others:
My swc was generated from Flash Professional CS5.5 and my Flex Project was being used in Flash Builder 4.5.

My swc was published to Flash Player 9 with ActionScript 3.0.
My flex project was using the 3.5.0.12683 SDK.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文