ActionScript 2.0类位置

I was recently working on a project that required me to upgrade a whole bunch of code from AS1.0 to AS2.0, and whilst the task was simple enough it involved several class files and hundreds of properties, methods and subclasses.

我最近正在从事一个项目,该项目需要我将一堆代码从AS1.0升级到AS2.0,尽管任务很简单,但它涉及多个类文件以及数百个属性,方法和子类。

There was also a requirement to alter the functionality of some of the functions, so I set about creating the external class files, and overhauling the code, popped the class files in the Flash MX 2004 ‘/Classes/ folder and set about making the alterations.

还需要更改某些功能的功能,因此我着手创建外部类文件,并对代码进行大修,在Flash MX 2004'/ Classes /文件夹中弹出类文件,并着手进行更改。

As there were many alterations, I needed to test the SWF from time to time, but the code changes in the class files were not propagating through to the compiled SWF. Very strange, so I restarted Flash MX 2004, recompiled the SWF, and the changes appeared.

由于存在许多更改,因此我需要不时测试SWF,但类文件中的代码更改并未传播到已编译的SWF中。 非常奇怪,所以我重新启动了Flash MX 2004,重新编译了SWF,并且出现了更改。

Even stranger was the fact that if you deleted the .as files from the ‘/Classes/’ folder of the installation directory the SWF still compiled! I thought there was some pretty heavy caching going on here, so searched for copies of the .as files I had just deleted, and sure enough there was a copy in another directory. I made some simple alterations to the .as files and hey presto, I could make changes to the class files without having to restart Flash!

甚至更陌生的事实是,如果您从安装目录的“ / Classes /”文件夹中删除了.as文件,SWF仍会编译! 我以为这里要进行大量的高速缓存,因此搜索了刚删除的.as文件的副本,并确定在另一个目录中有足够的副本。 我对.as文件进行了一些简单的更改,嘿,请记住,我可以对类文件进行更改,而不必重新启动Flash!

I remembered from the beta’s something about runtime locations of files being different for each user, so I bring this simple set of tips for using external classes to those who perhaps haven’t ventured into AS2.0 yet.

我从Beta版中记得有关每个用户的文件运行时位置不同的一些信息,因此我向那些可能尚未尝试使用AS2.0的人介绍了使用外部类的简单技巧。

[Note] These tips are for Windows based computers, but you get the idea.

[注意]这些技巧适用于基于Windows的计算机,但是您可以理解。

[Drive] = Installation Drive [Username] = Your Logon Account [Language] = Flash MX 2004 localization language (usually for International English it is ‘en’)

[驱动器] =安装驱动器[用户名] =您的登录帐户[语言] = Flash MX 2004本地化语言(对于国际英语,通常为“ en”)

1. Don’t save your class files in the Flash MX 2004 installation directory

1.不要将类文件保存在Flash MX 2004安装目录中

[Drive]:Program FilesMacromediaFlash MX 2004enFirst RunClasses

[驱动器]:程序文件MacromediaFlash MX 2004enFirst RunClasses

2. Be careful when saving your class files in the same folder as your FLA (I’ve had differing effectiveness results when editing the classes in this fashion), other people report success, whereas others report failure

2.将班级文件与FLA保存在同一文件夹中时要小心(以这种方式编辑班级时,效果有不同),其他人报告成功,而其他人报告失败

3. DO save your class files to your Local Settings folder

3.务必将课程文件保存到“本地设置”文件夹中

[Drive]:Documents and Settings[Username]Local SettingsApplication DataMacromediaFlash MX 2004[Language]ConfigurationClasses

[驱动器]:文档和设置[用户名]本地设置应用程序数据MacromediaFlash MX 2004 [语言]配置类

I’d be interesting in anyone developing AS2.0 projects on Mac OS’ to see if anyone else has encountered a similair situation

在Mac OS上开发AS2.0项目的任何人中,我都会很感兴趣,看看是否有人遇到类似的情况

翻译自: https://www.sitepoint.com/actionscript-20-class-locations/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值