mardi 14 juin 2016

AS3 package issue

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: Physical path on machine

I explicitly added it to the class search path:

Class path

So:

Name of package agrees with name of folder (I actually pasted it from folder to .as file)

Package file is within that folder.

Class search path includes that folder

Shouldn't matter for this but filename and public class name match

I've searched stack overflow and one similar case involved a text case mismatch that I don't see here. One other related question the guy's question turned into just how to make classes and name the files correctly.

According to the documentation I read, this should work fine. Can someone tell me what I am missing?

Aucun commentaire:

Enregistrer un commentaire