My question is as simple as the title, yet googling it didn't give me a simple yes/no answer.
Does AS3 have a class destructor?
In short: no, it doesn't. Flash Player virtual machine uses garbage collector concept. You don't have direct control over memory used by objects (except for rare cases like BitmapData.dispose() and ByteArray.clear()), but you are to do some work to make garbage collecting possible. And there is no way you can have something triggered automatically when an object dies.
Follow the links to learn more about GC logics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With