如何最好地将 AS1/AS2 应用程序转换为 ActionScript3 应用程序?

发布于 2024-07-16 16:15:34 字数 418 浏览 3 评论 0原文

我有一个由多个 SWF 组成的程序。 AS2-SWF 加载一堆 AS1-SWF。 这是一个蹩脚的程序。 我想在 MXML 中指定 GUI,并可能将一些代码重构为 AS3。 但是,将所有 300 多个符号转换为 AS3 或其他符号是不可撤销的。

转换为 AS3/Flex/MXML 时有哪些选择? 该应用程序非常简单,只是也很大。 它仅由按钮、背景和注意文本组成。 所有按钮文本都在 XML 文件中。

我想尽快将其转换为漂亮的代码,但也可以控制,以便代码变得:

  1. 易于更新/可维护,
  2. 可读
  3. 可学习(这样我就可以让只能编写 AS3 甚至 MXML 脚本的人完成更新)。

当然,这是我主动做的,如果超过一周,我就抽不出时间了。

问候, 尤尔根

I have a program consisting of multiple SWF's. An AS2-SWF loads a bunch of AS1-SWFs.
It's a crappy program. I'd like to specify the GUI in MXML and perhaps refactor some code to AS3. However, converting all of the 300+ symbols to AS3 or whatever is undoable.

What are my options in converting to AS3/Flex/MXML? The app is very simple, only also quite large. It consists only of buttons, backgrounds and attention-texts. All the button texts are in XML files.

I want to turn this into pretty code ASAP but also controlled so the code becomes:

  1. easily updateable/maintainable,
  2. readable
  3. learnable (so I can have the updating done by someone that can only script AS3 or even MXML).

Of course doing this is on my own initiative, if it'll take more than a week, I won't be able to find the time.

Regards, Jurgen

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

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

发布评论

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

评论(2

日暮斜阳 2024-07-23 16:15:34

这可能会有所帮助:

http:// /flexman.info/2009/03/29/as3converter-an-ant-task-small-collection-of-as3/

主要针对AS2代码,所以FLA编辑是不可能的。 但你当然应该看看 JSFL。

有一些非常好的脚本已经可以处理这样的事情:

http://bumpslide.com/blog/2009/03/07/jsfl-class-generator/

这个命令的作用是
浏览你的图书馆并发现
所有具有自定义的库项目
链接类名。 如果班级
扩展 flash.display.MovieClip (或者如果
基类为空),它检查
查看类文件是否存在,如果不存在,
它为你创造它。 当它发生时
这个,脚本会查看所有
时间线上的项目并添加
与您的班级相关的属性。 如果
这些剪辑是其他剪辑的实例
组件,它们将被键入为
此类以及相关的进口声明
将自动添加到您的
班级。 如果您的组件设置为
扩展一些其他类(例如,
com.bumpslide.ui.Button),无类
将被生成。 类文件将是
写入正确的包
第一个自定义类内的位置
您的发布设置中定义的路径。

This might help:

http://flexman.info/2009/03/29/as3converter-an-ant-task-small-collection-of-as3/

It's mainly for AS2 code, so FLA editing is out of the question. But you should certainly look into JSFL.

There are some pretty good scripts out there already dealing with something like this:

http://bumpslide.com/blog/2009/03/07/jsfl-class-generator/

What this command does is that it
looks through your library and finds
all library items that have a custom
linkage class name. If the class
extends flash.display.MovieClip (or if
the base class is blank), it checks to
see if a classfile exists, and if not,
it creates it for you. When it does
this, the script looks at all the
items on the timeline and adds
relevant properties to your class. If
these clips are instances of other
components, they will be typed as
such, and relevant import statements
will automatically be added to your
class. If your component is set to
extend some other class (for instance,
com.bumpslide.ui.Button), no class
will be generated. Class files will be
written to the correct package
location inside the first custom class
path defined in your publish settings.

羞稚 2024-07-23 16:15:34

尤尔根,我同情你……听起来工作量很大。

您有什么问题? 所有的 swf 都可以被视为不同的类吗? 逻辑上是否有很多重叠,或者每个对象都有特定的作用吗?

我认为拥有如此多不同的 SWF 可能会导致范围界定问题> 哪个 SWF 与哪个对话。 您也许可以使用 as3 设置一些使用现有部件的东西,然后尝试在现有代码上创建一个外观 > 使用 swf 中的现有逻辑并通过 mxml 完成可视部分。 除此之外,我所能建议的就是重建。 如果您缺少一些原始 fla,您可能会发现自己也需要 swf 反编译器

Jurgen, I feel for you... it sounds like a lot of work.

What sorts of issues do you have? are all the swfs treatable as different classes? is there much overlap in the logic or does each object have a specific role?

I think having so many different SWFs may possibly lead to scoping problems> which swf talks to which. you may be able to set up something with as3 that uses the existing parts and then try making a facade over the existing code > use the existing logic in the swfs and do the visual part through mxml. other than that, all I can advise is a rebuild. you might find yourself in need of a swf decompiler too if you are missing some of the original fla's

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