# Inheritance - how to extend a class

**URL:** https://forum.kirupa.com/t/inheritance-how-to-extend-a-class/315977
**Category:** Uncategorized
**Created:** [November 9, 2010, 5:58am UTC](https://forum.kirupa.com/t/inheritance-how-to-extend-a-class/315977 "2010-11-09T05:58:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![black\_pearl](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@black\_pearl](https://forum.kirupa.com/u/black_pearl)
#### Post date: [November 9, 2010, 5:58am UTC](https://forum.kirupa.com/t/inheritance-how-to-extend-a-class/315977/1 "2010-11-09T05:58:27Z")

</div>

I am working on inheritance for the first time

Here is the super class  
SetBlank.as

```auto

import flash.text.*;
class SetBlank {
    public var _textFieldName:TextField;
    public var _defaultName:String;
    public function SetBlank(textFieldName:TextField, defaultName:String) {
        _textFieldName = textFieldName;
        _defaultName = defaultName;
        if (_textFieldName.text == _defaultName) {
            _textFieldName.text = "";
        }

    }
}

```

I just want to inherit all the feature from SetBlank to ExtendSetBlank.as

ExtendSetBlank.as

```auto
import flash.text.*;
class ExtendSetBlank extends SetBlank{
    function ExtendSetBlank(){
        trace("abc")
    }
}

```

I can see the trace function working but the method which sets the text field to blank is now working. I can’t figure out where I am wrong.

Please help.
