# Problem with calling subclass function

**URL:** <https://forum.kirupa.com/t/problem-with-calling-subclass-function/315941>\
**Category:** Uncategorized\
**Created:** [November 8, 2010, 1:24pm UTC](https://forum.kirupa.com/t/problem-with-calling-subclass-function/315941 "2010-11-08T13:24:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bftawfik](https://avatars.discourse-cdn.com/v4/letter/b/e19b73/32.png) [@bftawfik](https://forum.kirupa.com/u/bftawfik)\
**Post date:** [November 8, 2010, 1:24pm UTC](https://forum.kirupa.com/t/problem-with-calling-subclass-function/315941/1 "2010-11-08T13:24:29Z")

</div>

i have this problem with calling subclass function  
please help  
this is how the code is :

```auto
package{
    public class A{
        public function A(){
        //
        }
    }
}
package{
    public class B extends A{
        public function B(){
        }
         public function bSayHello(){
        //
        }
    }
}
package{
     public class C{
        private var bInstance:A;
        public function C(){
            bInstance = new B();
             bInstance.bSayHello();
        }
    }
}

```

and i get this error  
**1061: Call to a possibly undefined method bSayHellothrough a reference with static type code.bInstance:A.**  
please help…!!!
