简体   繁体   English

将Com库添加到Flash CS5.5

[英]Add Com library to Flash CS5.5

I was watching some tutorial, and there trainer imported com.greensock.TweenLite 我正在看一些教程,培训师导入了com.greensock.TweenLite

I downloaded the greensock pacakge but can't figure out how, where to add this files so that when in AS3.0 i type import com.gre... it pops-up. 我下载了greensock pacakge,但不知道如何在哪里添加此文件,以便在AS3.0中输入import com.gre ...会弹出。

Any ideas? 有任何想法吗?

create a source directory anywhere you'd like to keep your own personal library and other 3rd party libraries. 在您想保留自己的个人图书馆和其他第三方图书馆的任何地方创建源目录。 for example, i put everything in a folder /Developer on my mac: 例如,我将所有内容放在Mac上的/Developer文件夹中:

在此处输入图片说明

from within Flash Professional CS5.5, select Preferences > Category: ActionScript > Language: ActionScript 3.0 Settings... 从Flash Professional CS5.5中,选择“首选项”>“类别:ActionScript”>“语言:“ ActionScript 3.0设置...”。

在此处输入图片说明

here, under Source Path , you will choose the folder on your file system that contains your source files. 在“ 源路径”下 ,您将在文件系统上选择包含源文件的文件夹。 when this is done, code completion should work with these files. 完成此操作后,代码完成适用于这些文件。

there are other ways to choose specific source paths for specific projects, but the steps i've outlined above is a global approach that only needs to be done once and will insure that the source files in your chosen directory will be accessible to all projects. 还有其他方法可以为特定项目选择特定的源路径,但是我上面概述的步骤是一种全局方法,只需要执行一次即可,并且可以确保所有项目都可以访问所选目录中的源文件。

You need to add the folder containing the com folder. 您需要添加包含com文件夹的文件夹。 So if you have TweenLite source in a directory like this: 因此,如果您在这样的目录中有TweenLite源:

C:\\Flash\\libs\\TweenLite\\com\\greensock C:\\ Flash \\ libs \\ TweenLite \\ com \\ greensock

Then you would need to add the following class path to Flash: 然后,您需要将以下类路径添加到Flash:

C:\\Flash\\libs\\TweenLite\\ C:\\ Flash \\ libs \\ TweenLite \\

Here is how to add a path to your classpaths in Flash: LiveDocs: Set the classpath for ActionScript 3.0 以下是在Flash中为类路径添加路径的方法:LiveDocs:设置ActionScript 3.0的类路径

Just place the com folder in the root of your project. 只需将com文件夹放在项目的根目录中即可。 Like so: 像这样:

在此处输入图片说明

Now you can access all classes in the greensock package. 现在,您可以访问greensock软件包中的所有类。 Just import them in your document-class: 只需将它们导入您的文档类中即可:

在此处输入图片说明

Here's an example using tweenlite to animate an object on the stage to alpha 1. 这是一个使用tweenlite将舞台上的对象动画化为alpha 1的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM