Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Can you have multiple packages in one source code file, or do you have to have multiple files?

Guest
Feb 21, 2016 Feb 21, 2016

Can you have multiple packages in one source code file, or do you have to have multiple files?

TOPICS
ActionScript
420
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 23, 2016 Feb 23, 2016

ExampleClass must be saved to a directory along with your main fla.

that directory must have a subdirectory named samples which contains SampleCode.

Translate
Community Expert ,
Feb 21, 2016 Feb 21, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 22, 2016 Feb 22, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2016 Feb 23, 2016
LATEST

ExampleClass must be saved to a directory along with your main fla.

that directory must have a subdirectory named samples which contains SampleCode.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines