解决将 FlashBuilder 项目迁移到 FDT 时出现的错误

发布于 2024-10-06 22:44:29 字数 1567 浏览 0 评论 0原文

我正在迁移 FlashBuilder 项目(实际上是我正在 Linux 上使用 FlexBuilder eclipse 插件开发的项目)以使用 FDT。我设法导入该项目,并使其了解它所依赖的其他项目。

然而,我遇到了很多看似无害(并用于编译)的编译错误。至少,例如:

<mx:SomeClass initialize="{this.init()}" ... >
   <mx:Script>
    <![CDATA[
         ....
        public function init() : void {
          // ... whatever
        }

        public function foo(event : Event) : void {
          // .. whatever
        }
            ]]>
    </mx:Script>
    <mx:SomeOtherComponent click="{this.foo(event)}"/>
 ... etc ....

因此,对于 someAttribute="{this.someFunction()}" 形式的所有调用,我都会得到“未解析的函数”,即使该函数是在同一个块文件中描述的。

难道是我一直在滥用 AS3 / FlashBuilder 吗?

此外,通用组件也存在问题。假设我有一个具有延迟“内容”属性的类,并且我想实例化该类并“填充空白”:

我在 CustomComponent.mxml 文件中定义一个自定义组件,并使用延迟内容

<mx:VBox>
 <mx:Script>
    <![CDATA[
      public var content : IDeferredInstance;

      public function buildMe() : void {
         this.addChild(content.getInstance() as UIComponent);
      }

在另一个文件中扩展自定义组件xml 文件,将某些内容作为内容(命名空间只是包含 CustomComponent 文件的命名空间的名称)

 <namespace:CustomComponent xmln:namespace="..." >
   <namespace:content >
        <!-- Whatever ... -->
   </namespace:content >
 </namespace:SomeClassWithDeferredInstance >

然后,我在第二个文件中再次收到“无法解析‘内容’”错误(在读取命名空间的行处) :内容)。

值得一提的是:

  • 我正在Linux下使用FDT 4.0,带有(有效)eval密钥
  • 我正在使用自定义的Flex 3.5 SDK(不是FDT附带的,但也不是太奇怪的)

希望任何人都可以提供帮助。 ..

谢谢

PH

I'm migrating a FlashBuilder project (actually a project I'm working on with FlexBuilder eclipse plugin on Linux) to use FDT. I managed to import the project, and make it aware of other projects it depends on.

However I get lots of compile errors for things that seem harmless (and used to compile). At least, for example :

<mx:SomeClass initialize="{this.init()}" ... >
   <mx:Script>
    <![CDATA[
         ....
        public function init() : void {
          // ... whatever
        }

        public function foo(event : Event) : void {
          // .. whatever
        }
            ]]>
    </mx:Script>
    <mx:SomeOtherComponent click="{this.foo(event)}"/>
 ... etc ....

So, I get "unresolved function" for all the calls of the form someAttribute="{this.someFunction()}", even though the function is described in the same block file.

Is it that I've been abusing AS3 / FlashBuilder for all this time ?

Also, generic components have problem. Assume I have a class with a deferred 'content' attribute, and I want to instanciate this class and "fill the blank" :

I define a custom component in a CustomComponent.mxml file, with a deferred content

<mx:VBox>
 <mx:Script>
    <![CDATA[
      public var content : IDeferredInstance;

      public function buildMe() : void {
         this.addChild(content.getInstance() as UIComponent);
      }

I extend the custom component in another xml file, putting something as the content (namespace is just the name of the namespace that contains the CustomComponent file)

 <namespace:CustomComponent xmln:namespace="..." >
   <namespace:content >
        <!-- Whatever ... -->
   </namespace:content >
 </namespace:SomeClassWithDeferredInstance >

Then again, I get an "Can't resolve 'content'" error in the second file (at the line that reads namespace:content).

Things to mention :

  • I'm using FDT 4.0, under Linux, with a (valid) eval key
  • I'm using a custom Flex 3.5 SDK (not one shipped with FDT, but not a too strange one either)

Hoping anyone can help ...

Thanks

PH

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

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

发布评论

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

评论(1

围归者 2024-10-13 22:44:29

如果它编译正确,并且没有任何编译器警告,那么这是解析器中的错误,而不是代码中的错误。请在 JIRA 中归档:http://bugs.powerflasher.com/jira/browse/FDT

对我来说,这段代码没有任何错误标志 - 我什至获得快速帮助来帮助我生成代码。

您的 FDT 版本也可能不正确。您使用的是 4.0,而且它已经很老了(大约一年)。从那时起,添加了许多功能并修复了错误。有关更多信息,请参阅发行说明。

http://fdt.powerflasher.com/docs/FDT_4_Release_Notes

我建议升级到 FDT 4.5.X

    <s:ApplicationminWidth="955" minHeight="600" initialize="{this.init();}">
    <fx:Script>
      <![CDATA[
            private function init() : void {}
            private function foo(event : MouseEvent) : void {}
       ]]>
       </fx:Script>
       <s:Button click="this.foo(event);"/>
    </s:Application>

If it compiles correctly, and without any compiler warnings, then it's a bug in the parser and not in your code. Please file it in JIRA: http://bugs.powerflasher.com/jira/browse/FDT

For me, this bit of code does not have any error flags - I even get quick assists to help me generate code.

Your FDT version might be incorrect as well. You're using 4.0 and that is quite old (about a year). Since then many features have been added and bugs fixed. See the release notes for more.

http://fdt.powerflasher.com/docs/FDT_4_Release_Notes

I suggest upgrading to FDT 4.5.X

    <s:ApplicationminWidth="955" minHeight="600" initialize="{this.init();}">
    <fx:Script>
      <![CDATA[
            private function init() : void {}
            private function foo(event : MouseEvent) : void {}
       ]]>
       </fx:Script>
       <s:Button click="this.foo(event);"/>
    </s:Application>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文