use class in extra file?

Hi there,

I have a js file named “SaveGame.js”.

inside, there’s

    class Level
    {
    	var score:int;
    	var bestTime:float;
    	var highestScore: int;
    	function Level(number:int)
    	{
[...]
    	}
    }

and from another file i’m trying to call

var thisLevel=SaveGame.Level(number);

but i’m getting the message "‘Level’ is not a member of ‘SaveGame’ from the compiler.

How does that work? Shouldn’t I be able to instantiate Level from another file?

You need to create a new instance. You don’t need to refer to the file name.

var thisLevel = new Level(number);

Your Save file should be the same name as your class (i.e. Level.js)