Copy link to clipboard
Copied
Can you have multiple packages in one source code file, or do you have to have multiple files?
ExampleClass must be saved to a directory along with your main fla.
that directory must have a subdirectory named samples which contains SampleCode.
Copy link to clipboard
Copied
you can have multiple classes, but not multiple packages.
the package name specifies class file's location and one file cannot be in multiple locations.
Copy link to clipboard
Copied
OK so I have to use separate files, I’ve been trying to do this but it has not been working.I’ve been following the instructions on the web site below.Basically what I’ve been doing is :package samples { public class SampleCode { public function SampleCode() { } }}Located in one file and in a second file:package { import samples.SampleCode; public class ExampleClass { public function ExampleClass(){ } }}But it just gives me error messages saying that it can’t find the imported class from the second file.http://www.adobe.com/devnet/actionscript/learning/as3-fundamentals/packages.html
Copy link to clipboard
Copied
ExampleClass must be saved to a directory along with your main fla.
that directory must have a subdirectory named samples which contains SampleCode.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now