Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

importing .as files

Status
Not open for further replies.

kaboomer13

Programmer
May 15, 2006
5
CA
Hello, I have a .as class file in a seporate folder that I would like my program to call. The problem is that it is up one folder first:

folderA -+
|
+ FolderB -+
| |
| +File.as
|
+ FolderC -+
|
+File.fla

I can create a shell of the file I want and then use the #include function to import the .as file as if it were always there, but then all the .gif's I need are not referenced properly, and there is no way to search for the correct gif's in flash that I can find.

Any help would be greatly appriciated,

Ben
 
You will need to reference your AS file like this:

#include "../folderB/File.as"

Then File.as will become part of File.fla, file paths in the AS file needs to be written as if referenced from the FLA file, not from the AS file.

Kenneth Kawamoto
 
Thanks Kenneth, I did try that but the problem is bigger, I work for a project team working under the government of Alberta, and I am in charge of a plug-in for all of the applets, a grapher. I can make it work by just putting the .as files and the .gif files in the correct folder, but it is very unprofessional to have multiple copies and versions of this library item floating around the server.
What I really want is a way that any program can easily reference the grapher where it is.

Thanks
 
a class I have made that allows the host program to send it values that come out of the simulation suck as Velocity, time, mass, height, etc... it will graph these values.
 
If it's a Class file, you should be using "import", not "#include".

Also as oldnewbie said you'll need AS files in the compile time, not runtime. So everyone who wants to use your Class has to have a copy of it locally.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top