在 Flash Develop 中导入 Flex 项目的 SWC

发布于 2024-07-25 16:18:48 字数 1039 浏览 4 评论 0原文

我刚刚开始将 flashdevelop 用于 Flex 应用程序(之前我一直将其用于纯 as3 项目)。 我不知道如何导入文件等。 我像往常一样将它们纳入图书馆。 在本例中,我包含了 flexlib.swc 和 flexmdi.swc。 两者都在我的 lib 文件夹中,并且都已右键单击并添加到库中。

自动完成不起作用,所以我想我错过了一个步骤。

这是我的代码: `

<flexmdi:MDICanvas id="mdic" width="500" height="500">
    <flexmdi:MDIWindow id="win1" title="Window One" x="10" y="10">
        <samples:SampleContent />
    </flexmdi:MDIWindow>
    <flexmdi:MDIWindow id="win2" title="Window Two" x="250" y="250">
        <samples:SampleContent />
    </flexmdi:MDIWindow>
    <flexmdi:MDIWindow id="win3" title="Window Three" x="100" y="100">
        <samples:SampleContent />
    </flexmdi:MDIWindow>
</flexmdi:MDICanvas>

`

我还尝试添加

<mx:Script>
        <![CDATA[
        import flexmdi.containers.MDICanvas;
        import flexmdi.containers.MDIWindow;
        ]]>
    </mx:Script>

我也收到一个奇怪的错误,说 flexmdi:MDICanvas 未绑定。

I just started using flashdevelop for flex apps (I had been using it for pure as3 projects previously). I can't figure out how to import files and such. I have included them to the library as usually. In this case I have included flexlib.swc and flexmdi.swc. Both are in my lib folder and both have been right clicked and Added to the Library.

Auto complete does not work so I think I am missing a step.

This is my code:
`

<flexmdi:MDICanvas id="mdic" width="500" height="500">
    <flexmdi:MDIWindow id="win1" title="Window One" x="10" y="10">
        <samples:SampleContent />
    </flexmdi:MDIWindow>
    <flexmdi:MDIWindow id="win2" title="Window Two" x="250" y="250">
        <samples:SampleContent />
    </flexmdi:MDIWindow>
    <flexmdi:MDIWindow id="win3" title="Window Three" x="100" y="100">
        <samples:SampleContent />
    </flexmdi:MDIWindow>
</flexmdi:MDICanvas>

`

I also tried to add

<mx:Script>
        <![CDATA[
        import flexmdi.containers.MDICanvas;
        import flexmdi.containers.MDIWindow;
        ]]>
    </mx:Script>

I also get a strange error saying flexmdi:MDICanvas is not bound.

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

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

发布评论

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

评论(2

忘你却要生生世世 2024-08-01 16:18:48

我可能离这里很远,因为我们正在谈论 FlashDevelop,但我很确定您需要在 MXML 根标记中添加 MDICanvas 的命名空间,如下所示:

    <?xml version="1.0" encoding="utf-8"?>
    <MDICanvas xmlns="flexlib.mdi.containers.*" xmlns:mx="http://www.adobe.com/2006/mxml"    width="400" height="300">
       ...
    </MDICanvas>

导入语句仅适用于 .as 文件或 部分。

因重复而死亡,但 Flex 有两种导入类和包的方法。 MXML方式和AS3方式。

I might be way off here because we're talking about FlashDevelop, but I'm pretty sure you need to add the namespace for the MDICanvas in your MXML root tag, like this:

    <?xml version="1.0" encoding="utf-8"?>
    <MDICanvas xmlns="flexlib.mdi.containers.*" xmlns:mx="http://www.adobe.com/2006/mxml"    width="400" height="300">
       ...
    </MDICanvas>

The import statements only apply to .as files or <mx:Script> sections of your MXML code.

Death by repetition, but Flex has two ways to import classes and packages. The MXML way and the AS3 way.

固执像三岁 2024-08-01 16:18:48

不幸的是,FlashDevelop 的最新稳定版本不支持 MXML 中的代码完成,尽管该功能已在 AS 中完全实现(您可以在 ActionScript 中使用代码完成来浏览库中的包)。

如果您需要 MXML 方面的帮助,我建议保持该库的 API 与 FlashDevelop 并行开放(无论如何,这是我更喜欢做的事情)。 尽管如此,您仍需要确保包含所有 XML 命名空间。 例如,对于 Degrafa 图形库,您需要包含

xmlns:gfx="http://www.degrafa.com/2007"

在标签中(已经存在命名空间“mx”的类似命名空间定义)。

然而,MXML 代码补全有望很快在稳定版本中实现,并且已经有

Unfortunately, the latest stable releases of FlashDevelop does not support code completion in MXML, although the feature is fully implemented in AS (you can browse packages in libraries with code completion in actionscript).

If you need help with MXML, I suggest keeping the library's API open side-by-side with FlashDevelop (it's what I prefer to do anyway). Still, you need to make sure that you include all of the XML namespaces. For example, for the Degrafa graphics library, you need to include

xmlns:gfx="http://www.degrafa.com/2007"

in the tag (there is also a similar namespace definition for the namespace "mx" already there).

However, MXML code completion is hopefully going to be implemented in a stable release very soon, and there have already been some ways to get it working.

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