it depends on how you use them.
First i'd suggest you get a better knowledge of OOP in general.
Then read about the OOP for actionscript.
In your case, you should do something like old school c++,
creating a destructor function in your classes, which will reset most of the variables, and call it from the other class, before removing it.
Something like:
// in ClassCaller you add
public function Destructor()
{
timerClass.Destructor();
timerClass = null;
// any other code in here
}
// in TimerClass
public function Destructor()
{
myTimer.stop();
myTimer = null;
// any other code
}
// before removing the class ... which i suppose you just set it to null because as far as i`m aware, there's no such thing as removing a class ... a child yes, but not a class object
classCaller.Destructor();
classCaller = null;
- // in ClassCaller you add
- public function Destructor()
- {
- timerClass.Destructor();
- timerClass = null;
- // any other code in here
- }
- // in TimerClass
- public function Destructor()
- {
- myTimer.stop();
- myTimer = null;
- // any other code
- }
- // before removing the class ... which i suppose you just set it to null because as far as i`m aware, there's no such thing as removing a class ... a child yes, but not a class object
- classCaller.Destructor();
- classCaller = null;
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”