简体   繁体   中英

How to access a as3 class from another folder in Flash?

Please see the example that i want to ask:

1) Main/ProjectFolder/MyProject.fla
2) Main/AS_Classes/CommonClass.as

ok, i have a commonClass.as file in different folder. I created a flash file 'MyProject.fla' in ProjectFolder and i want to import CommonClass.as file inside MyProject file.
But i don't know how to access that as3 file. Any Suggestion for this?

Thank You

include "../../AS_Classes/CommonClass.as";

if you import Class file, you should add Main/AS_Classes folder to Library path in Publish Setting (ActionScript 3.0 Settings) of MyProject.fla, like this: AS3-libary路径的设置

then

import CommonClass;

please make sure your CommonClass using default package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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