Skip to main content
Participating Frequently
June 17, 2016
Question

Package issue

  • June 17, 2016
  • 1 reply
  • 1345 views

Really want to refactor and re-architect my project, it's become basically an 11k line monobloc that desperately needs to be split into multiple classes (and class files) inside a single package.

Yes I know I should have figured all this out when I started, but this is play not work and I was brand new to AS3 when I started. And I've kept building and building and it all works, it's just become very hard to manage.

My immediate goal is to define a package and then start breaking out function groups from the current main class into subclasses that extend the base. But I'm having a problem with the first step - defining the package.

I'm getting:

C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\LOB_Core.as, Line 1, Column 1 5001: The name of package 'line_of_battle' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\LOB_Core.as

So I've checked:

package line_of_battle {
public class LOB_Core extends flash.display.MovieClip {

Filename is LOB_Core.as.

Path:

Class path:

Such a simple thing but I must be missing something since I keep getting the same error. I even created a new folder in a new location and created new test package parent class and child class with all new names carefully checked, and I get the exact same error. It keeps insisting my package name doesn't agree with the folder name even though that is clearly not the case.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 17, 2016

your main file needs to be in trunk.  at least, that's how it would work with flash/animate.

Participating Frequently
June 20, 2016

Sorry for slow response, as noted above this isn't work and I got pulled away for a couple days.

This does not seem to work either. I just created a folder called Flash Test and made a testClass.as and testClass.fla files inside. I gave the testClass the package name of packageTest. Then I created a folder called packageTest inside

packagepackageTest{
public class testClass {

C:\Users\Vossie\Documents\Flash Test\testClass.as, Line 1, Column 15001: The name of package 'packageTest' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Users\Vossie\Documents\Flash Test\testClass.as
kglad
Community Expert
Community Expert
June 20, 2016

there's a testClass.as file that is not in the packageTest folder.  fix that by deleting the testClass.as shown in your screenshot.

save a testClass.as with package equal to packageTest in the packageTest folder if there's not one there already.  retest.