Grofit
September 24th, 2007, 06:51 AM
Hello!
I got my hands on Flash 9 the other day so i started trying to write some classes to do some similar stuff to what i did in AS2. I made a project, made 2 .as files:
// flashtest1.as
package flashtest.base
{
// firstclass
}
// flashtest2.as
package flashtest.main
{
// secondclass
}
Then i thought, ok those seem to be ok lets add this to my .fla file so i open that up and do:
import flashtest.main.*;
Keeps saying "Definition flashtest.main could not be found", so i thought ok, lets just do it directly to the class in there:
import flashtest.main.secondclass;
Still same error, so at this point i thought ok, lets go out on the net and see if anyone can show me how to use .as files classes in my .fla file. After 2 hours of looking im still stumped. Is there some magical way to link .as files into .fla files these days?
Any advice would be great!
- Edit -
Just realised that im being kinda vauge there, so just some more information to help you help me :D
- The classes defined in the packages are all public with valid constructors
- The files are all in the same folder on the computer
- The case is the same on the filenames/classnames/package names
- They are all within a project file and they are the only files in it
All the tutorials and examples i see online dont seem to use .fla files to run the code they do it all internally in the .as by dynamically creating the items they need, but im going to need to write external .as files and use them in .fla files...
Hope that helps a bit more :D
I got my hands on Flash 9 the other day so i started trying to write some classes to do some similar stuff to what i did in AS2. I made a project, made 2 .as files:
// flashtest1.as
package flashtest.base
{
// firstclass
}
// flashtest2.as
package flashtest.main
{
// secondclass
}
Then i thought, ok those seem to be ok lets add this to my .fla file so i open that up and do:
import flashtest.main.*;
Keeps saying "Definition flashtest.main could not be found", so i thought ok, lets just do it directly to the class in there:
import flashtest.main.secondclass;
Still same error, so at this point i thought ok, lets go out on the net and see if anyone can show me how to use .as files classes in my .fla file. After 2 hours of looking im still stumped. Is there some magical way to link .as files into .fla files these days?
Any advice would be great!
- Edit -
Just realised that im being kinda vauge there, so just some more information to help you help me :D
- The classes defined in the packages are all public with valid constructors
- The files are all in the same folder on the computer
- The case is the same on the filenames/classnames/package names
- They are all within a project file and they are the only files in it
All the tutorials and examples i see online dont seem to use .fla files to run the code they do it all internally in the .as by dynamically creating the items they need, but im going to need to write external .as files and use them in .fla files...
Hope that helps a bit more :D