ASC 2.0是否识别[Frame]元数据标签(例如:Preloader factoryClass)? [英] Does ASC 2.0 recognize [Frame] metadata tags (ex: for Preloader factoryClass)?

查看:283
本文介绍了ASC 2.0是否识别[Frame]元数据标签(例如:Preloader factoryClass)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在AIR SDK 3.7中使用新的ASC2.0编译器,但是我似乎遇到了无法检测到我的预加载器类的问题。

I'm trying to use the new ASC2.0 compiler in the AIR SDK 3.7, but I seem to be running into a problem where it cannot detect my preloader class.

如果我使用非ASC2.0编译器,它会识别并编译在Main类中的框架元数据标签中声明的Preloader类,如下所示:

If I use the non-ASC2.0 compiler, it recognizes and compiles the Preloader class declared in the Frame metadata tag in my Main class, like so:

[Frame(factoryClass = "Preloader")]

很快,当我用ASC2.0编译它,它忽略了框架元数据,只是试图编译Main类,并假设它已经是Sprite / MovieClip的子类(当它被预加载时,它不一定是必须的)框架元数据标签),因此无法编译。

But as soon as I compile it with ASC2.0, it disregards the Frame metadata and just tries to compile the Main class and assume that it HAS to be a subclass of Sprite / MovieClip (which it does not necessarily have to be when it is Preloaded with a Frame metadata tag), so it fails to compile.

如果有人可以确认这将是伟大的,一直旋转我的轮子在这一段时间。谢谢!

If someone can confirm this that'd be great, been spinning my wheels on this for a while. Thanks!

推荐答案

显然,不再支持。这里有一个类似的问题:

Apparently, it is no longer supported. There was a similar question asked here:

ASC2.0和Frame元标记

新解决方案似乎是:

strong>您必须为 -frame 数据手动添加编译器参数。

You have to manually add the compiler arguments for the -frame data.

要使这个工作,你必须设置你的项目有点不同于 [Frame] 元数据技术。

However, to get this working, you have to setup your project a bit differently from the [Frame] metadata technique.


之前(当使用旧的 [Frame] 元数据技术)时,必须
指定Main类作为Document类然后
编译并将主入口点重定向到您指定的Preloader
类)。

Before (when using the old [Frame] metadata technique), you had to specify your Main class as the Document class (which would then compile and redirect the main entry point to your designated Preloader class).

这里有一些您必须设置的东西:

Here's a few things you must setup:


  • 您的预加载器类应该延伸 Movieclip >

  • 分配您的Preloader.as类(或者你调用它)
  • -frame = AnyFrameLabelYouWant,YourMainClass
  • 此外,请使用此其他编译器参数添加SWF版本:
    -swf-version = 18 (虽然我认为17将与ASC2.0一起使用...)

  • 确保您使用的是 ASC2.0 SDK 编译器。

  • Your Preloader class should extend Movieclip subclass.
    (This makes it possible for your Main content to embed on Frame #2)
  • Assign your "Preloader.as" class (or however you called it) as the Document class.
  • Put this Additional Compiler Argument:
    -frame=AnyFrameLabelYouWant,YourMainClass
  • Also, add the SWF version with this Additional Compiler Argument:
    -swf-version=18 (though I think 17 will work with ASC2.0 as well...)
  • Make sure you are using the ASC2.0 SDK compiler in your IDE!

注意:现在我想起来了,也许是可能的注入 / ** @mxmlc * / JavaDoc注释给编译器的指令,但我没有尝试这个。这可能是ASC2.0编译器中缺少元数据支持的解决方法。 (编辑:我试过这个功能,这个功能只适用于FlashDevelop中的Build工具栏按钮,它只编译当前焦点的文件)

NOTE: Now that I think about it, maybe it's possible to inject /** @mxmlc */ JavaDoc comments to give the instructions to the compiler, but I didn't try this yet. That may be a workaround for the lack of Metadata support in the ASC2.0 compiler. (edit: I tried this once and this feature only seems to work with the "Build" toolbar button in FlashDevelop, which only compiles the currently focused file)

这篇关于ASC 2.0是否识别[Frame]元数据标签(例如:Preloader factoryClass)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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