Error when using getter/setter methods on Sprite <p>I'm trying to make a class that extends the Sprite, have some private properties attached to it and be able to read and write those properties using getters and setters. Simple... but the compiler throw this error "Access of possibly undefined property speed through a reference with static type flash.display:Sprite." It works if I set my class to extend the MovieClip object. Could someone explain me the logic behind this? why I can't use getter and setters with a Sprite?</p> <p>Here is a sample code:</p> <pre><code>package { import flash.display.Sprite; public class Vehicle extends Sprite{ private var _speed:uint = 3; public function get speed():uint { return _speed; } public function set speed(value:uint):void { _speed = value; } public function Vehicle() { super(); } } } </code></pre>