While looking through the Flex 2.0 help files, I discovered a great little section on inheritance. Near the bottom, I found a section that covers overriding getters and setters. It included the following code:
package { import flash.display.MovieClip; public class OverrideExample extends MovieClip { public function OverrideExample() { trace(currentLabel) } override public function get currentLabel():String { var str:String = "Override: "; str += super.currentLabel; return str; } } }
You’ll notice that the currentLabel
getter calls super.currentLabel
. That never worked in AS2. It makes me happy. 🙂