Question
Overloading constructors and parsing instance of class to itself
Hi,
I have a class called Screen. This class I ideally want to have two constructors, but from what I understand this isn't possible in ActionScript 2. The reason I need this is because I want to be able to, in some cases, parse an instance of a Screen object (the same as the class) to a new Screen object. Can I do this? I've tried using default parameters (= null) but I get compiler errors!
I attach my code so far.
What I'm trying to achieve basically, is to seperate the GUI, i.e. the Scene from the data and logic below. So each screen will look the same but will just have different info/images. I have buttons you see which allow navigation through said screens and so I need to tell each screen object the next and previous screens.
Thanks,
I have a class called Screen. This class I ideally want to have two constructors, but from what I understand this isn't possible in ActionScript 2. The reason I need this is because I want to be able to, in some cases, parse an instance of a Screen object (the same as the class) to a new Screen object. Can I do this? I've tried using default parameters (= null) but I get compiler errors!
I attach my code so far.
What I'm trying to achieve basically, is to seperate the GUI, i.e. the Scene from the data and logic below. So each screen will look the same but will just have different info/images. I have buttons you see which allow navigation through said screens and so I need to tell each screen object the next and previous screens.
Thanks,