# Extending an Abstract class

**URL:** <https://forum.kirupa.com/t/extending-an-abstract-class/269896>\
**Category:** Uncategorized\
**Created:** [September 2, 2008, 8:34pm UTC](https://forum.kirupa.com/t/extending-an-abstract-class/269896 "2008-09-02T20:34:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RebuiltJorge](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@RebuiltJorge](https://forum.kirupa.com/u/RebuiltJorge)\
**Post date:** [September 2, 2008, 8:34pm UTC](https://forum.kirupa.com/t/extending-an-abstract-class/269896/1 "2008-09-02T20:34:03Z")

</div>

i have an abstract class called Ship(extends Sprite), Ship is extended by two other classes Falcon and TieFighter. Ship,Falcon, and TieFighter are all in a package called “Ships”. Falcon class is linked up to an image in the library with base class set as flash.display.Sprite. Next I have a class called Main.as.(placed outside of the “Ships” package) Code in there looks like

var falcon:Ship = new Falcon();  
falcon.x = 100;  
falcon.y = 100;  
addChild(falcon);

obviously this doesn’t work(implicit coercion of value type Falcon to an unrelated type ships:Ship), to make this work i have to do either var falcon:\* or var falcon:Falcon, how come I can’t type it as a Ship since technically it extends Ship,
