Hi everyone,

This seems like a very simple thing to do, but I can't figure out why it won't work.  Basically, what I am aiming for is to have a separate .as file that contains only constants (no classes or functions...just constants).  I have this ActionScript class, say "ClassOne.as" that uses a lot of constants.  I have another ActionScript class, say "ClassTwo.as" that also uses the same constants.  Right now, all of the same constants are declared twice, once in each class.  But what I want is to make a seperate file to just hold those constants and then "import" them from both classes, but I can't figure it out.

 

I know that to "import" external .as files in an .mxml file, you can just use <Script source="file_name.as"/>.  But, to "import" an external .as file from within another .as file, I don't know how.  I've tried using import files.*, but since the file is just a list of constants, and not a class, it doesn't work.  I've also tried include "files/file_name.as", but I get an error for having "more than one externally visible definition"...?

 

Any help would be great...my code is too bloated to stand right now, with all this redundant code...haha

 

Thanks in advance.

 

 

Charles



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to