I’m getting the “Base class is final” error on a project that uses the AIR for iOS player. Problem is I didn’t set the base class to be final. Also this only happens when I use AIR as the player.
Main – document class
package {
import flash.display.*;
import parentfolder.*;
import parentfolder.childfolder.*;
public class Main extends MovieClip {
public function Main () {
addChild (new SplashScreen ());
}
}
}
Screen – inside parentfolder which is in the same folder as the document class
package parentfolder {
import flash.display.*;
public class Screen extends Sprite {
public function Screen () {
}
}
}
SplashScreen – inside parentfolder
package parentfolder.childfolder {
import flash.display.*;
import parentfolder.*;
public class SplashScreen extends Screen {
}
}
So…there’s no “final” anywhere in the code and the problem is isolated in the AIR player.
There is a class in AIR called Screen, which is declared as final. You’ve used the
.*notation on your imports, thereforeflash.display.Screenis assumed as the base class forSplashScreen, instead of your customparentfolder.Screen.Since this class exists only in AIR, the problem does not occur in other players.
You should always use fully qualified imports (one for each class) to avoid naming conflicts like this.