package oreilly.cookbook { publicclass Car extends Transport { publicfunction set data(value:Object):void { info = value; speed = value.speed; /* this will throw an error because the speed variable is private and access to it is not allowed to any other class */ } } }
Transport 類的protected屬性可用于Car類,但是不能用于把它作為一個屬性的其他類實例中。