I’m currently migrating a Flash game over to AS3 and I’m having trouble changing my classes into packages. I have a folder called “actionscript” which contains all my packages/classes, etc.
My main class file, “Main.as”, looks like this:
package actionscript
{
// Flash packages
import flash.media.Sound;
...
import flash.events.KeyboardEvent;
// My packages (found in same “actionscript” folder)
import Inventory;
...
import Level1;
public class Main
{
private var _currentLevel;
...
private var _inventory;
/**
* Constructor
*/
public function Main()
{
...
}
...
}
}
I have the following code on frame 1:
import actionscript.Main;
var Main:Main = new Main();
But I get this error:
“1046: Type was not found or was not a compile-time constant: Main.”
Any idea what’s going on?
Thanks!