[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


simple question for as developer

Posted on 2006-04-08
Medium Priority
Last Modified: 2010-04-03
hello everyone, I know this is may be a stupid question, but I just started to code in AS few weeks ago. Instead of having the whole long confusing piece of code in one file, can I "scatter" the different classes in different files?
thanks k
Question by:kugo
LVL 49

Expert Comment

ID: 16407587
You can use the #include 'myfile.as' statement (don't add a semicolon to the end).

The path to the as file is calculated from the base of your .fla file.

so when you have below filestructure and want to include as2.as from as1.as.

Then you would still have to use:
#include 'as/as2.as'

LVL 39

Accepted Solution

blue-genie earned 100 total points
ID: 16415031
are you using AS2.0 or AS1.0?
if you're using as2.0 each class needs to be in a separate class file, your class files can be located anywhere though would be most wise to set in one location so you can set your class path.
also, in AS2.0 you wouldn't use include but rather import.

in as1.0 you can do it as roonaan says.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question