通过 ObjectID 附加 swf 元素

发布于 2024-08-05 08:20:23 字数 175 浏览 3 评论 0原文

我有 swf 文件,其中包含一些图形,我需要在我的 haxe(将来也编译为 swf)程序中使用。 swfmill嵌入图片没有问题,所以我尝试用swfmill反汇编swf,发现一些像DefineSprite和DefineShape这样有objectID的条目。

是否可以使用 swf 文件作为库从 haxe 附加这些元素?

I have swf file with some graphics I need to use in my haxe(future compiled to swf too) program. There is no problem with embedding pictures by swfmill, so i tried to disassemble the swf with swfmill and found some entries like DefineSprite and DefineShape which have objectID's.

Is it possible to attach these elements from haxe using the swf file as a library?

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

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

发布评论

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

评论(1

闻呓 2024-08-12 08:20:23

您可以附加一个元素(图片、声音等),如果它们具有:

  1. 为它导出的 SymbolClass(或者 ExportAsset)
  2. 生成的 AS3 类存根(至少对于 flash9+) - Haxe 会处理这个问题,至少对于第一个资源 对于haxe框架

,你必须支持
-swf-lib mylib.swf
switch,只接受一个swf作为参数。如果您想使用多个库,可以使用 swfmill 或 SamHaxe 将它们组装成一个库,并支持组装的库。

然后,您可以从 Haxe 使用

var mySprite: flash.display.Sprite = cast 
Type.createInstance(Type.resolveClass("the.exported.SpriteSymbolName"), []);

var myBitmap: flash.display.Bitmap = cast 
Type.createInstance(Type.resolveClass("the.exported.BitmapSymbolName"), []);

希望这会有所帮助。

You can attach an element (picture, sound, etc) if they have:

  1. SymbolClass exported for it (or maybe ExportAsset)
  2. AS3 class stub generated (for flash9+ at least) - Haxe will take care of this, at least for resources on the first frame

For haxe, you have to support the
-swf-lib mylib.swf
switch, which takes only one swf as parameter. If you would like to use multiple libs, you can assemble them into one with either swfmill or SamHaxe, and suppprt the assembled lib.

From Haxe, you can then use

var mySprite: flash.display.Sprite = cast 
Type.createInstance(Type.resolveClass("the.exported.SpriteSymbolName"), []);

var myBitmap: flash.display.Bitmap = cast 
Type.createInstance(Type.resolveClass("the.exported.BitmapSymbolName"), []);

Hope this helps.

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