/*
class ClassName extends SuperClassName {
// Class definition goes here.
}
*/
package{
import flash.display.Sprite;
publicclass Main extends Sprite{
public function Main(){
var rBunny:Rabbit = new Rabbit("William", "White and Brown");
trace(rBunny.name); // Displays: William
trace(rBunny.coloration); // Dislays: White and Brown
}
}
}
class Mammal {
var _sName:String;
public function get name():String {
return _sName;
}
public function set name(sName:String):void {
_sName = sName;
}
}
class Rabbit extends Mammal {
public var _sColoration:String;
public function Rabbit(sName:String, sColoration:String) {
_sName = sName;
_sColoration = sColoration;
}
public function get coloration():String {
return _sColoration;
}
}