本文介绍了如何在AS2 Flash项目中包含SWC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在AS3中,我知道如何做到这一点。只需单击ActionScript设置,然后导航到包含SWC文件的SWC文件或文件夹下的SWC文件。



然而,当该项目被设置为AS2中,ActionScript 2.0设置是一个相当稀疏菜单,以及将所述文件夹作为类路径似乎不工作。



可这甚至可以实现呢?


解决方案

假设你的SWC是作为编译组件创建的AS2,您必须将其添加到您的Flash组件文件夹。对我来说,使用CS4 Win7上的路径是:





一旦做到这一点,重新启动Flash和组分SWC应该可见在IDE的组件面板中。将其拖到舞台上,然后将其删除,这会将其副本留在您的资料库中。您现在应该可以通过代码访问SWC中的类。



(也包含超出问题范围的SWC创建说明)

In AS3, I know how to accomplish this. One needs only to click "ActionScript Settings", and navigate to the SWC file under "SWC Files or Folders Containing SWC Files".

However, when the project is set to AS2, the "Actionscript 2.0 Settings" is a rather sparse menu, and adding the folder as a classpath doesn't seem to work.

Can this even be accomplished?

解决方案

Assuming that your SWC was created for AS2 as a compiled component, you have to add it to your Flash components folder. For me, using CS4 on Win7 the path is:

Once this is done, restart Flash and the component SWC should be visible in the Components panel of the IDE. Drag it to the stage and then delete it, which will leave a copy of it in your library. You should now be able to access the classes within the SWC in code.

Source (also contains instructions for SWC creation which is beyond the scope of the question)

这篇关于如何在AS2 Flash项目中包含SWC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-22 21:39