/t5/animate-discussions/adding-classes-to-flash-cs3-project/td-p/265518Mar 27, 2009
Mar 27, 2009
Copy link to clipboard
Copied
Forgive me I'm a newbie when it comes to Flash projects. I
have the source code for a Flash based media player written in
Action Script 3 that I need to modify. I’m trying to add
classes to this project in Flash CS3 however after I import them
and try to reference the classes in an existing class within the
original source I get the following error when I try to build:
1172: Definition ‘classname’ could not be found.
However the project builds fine if I don’t reference
any of the newly imported classes. What am I missing here?
From a brief look you need to import your new package into
existing class:
import alducente.services.*;
Also make sure that you provide a path to this package in
Flash publishing preferences - you need to start with a directory
that one level up. For instance, if your new classes reside in a
path: c:/documents/classes/alducente/services, you need to tell
Flash that you classes are in c:/documents/classes - not in
c:/documents/classes/alducente
Okay, here's the code. The first class is the one I imported
into my existing project. The second class is the existing class
from the projects original source code where I'm trying to
reference my new class.
From a brief look you need to import your new package into
existing class:
import alducente.services.*;
Also make sure that you provide a path to this package in
Flash publishing preferences - you need to start with a directory
that one level up. For instance, if your new classes reside in a
path: c:/documents/classes/alducente/services, you need to tell
Flash that you classes are in c:/documents/classes - not in
c:/documents/classes/alducente
I think I have it now. I went into the Preferences, selected
the ActionScript category and went to the ActionScript 3.0 Settings
dialog and added a class path that pointed to the root of my
project classes and now it compiles fine. Thanks,