# AS3 Check if a derrived class function exists

**URL:** https://forum.kirupa.com/t/as3-check-if-a-derrived-class-function-exists/308518
**Category:** flash
**Created:** [April 24, 2010, 6:39pm UTC](https://forum.kirupa.com/t/as3-check-if-a-derrived-class-function-exists/308518 "2010-04-24T18:39:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Simmoniz](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Simmoniz](https://forum.kirupa.com/u/Simmoniz)
#### Post date: [April 24, 2010, 6:39pm UTC](https://forum.kirupa.com/t/as3-check-if-a-derrived-class-function-exists/308518/1 "2010-04-24T18:39:32Z")

</div>

Hi

I have a little question. Is there a way to check if a derrived class contains a function. If so, call it otherwise keep going.

Quick exemple :

“myClass.as”

```auto
package{
	public class myClass extends mySuperClass{
		public function myClass(){
			if(this["myExistingFunction"]!=null)this["myExistingFunction"]();
			if(this["someFunction"]!=null)this["someFunction"]();
		}
	};
}

```

“mySuperClass.as”

```auto
package{
	public class mySuperClass{
		public function muSuperClass(){}
		public function myExistingFunction(){ trace("this function exists!"); }
	}
}

```

main code

```auto
new myClass();

```

When Flash checks a function that does not exists, its throws the error “ReferenceError: Error #1069” (5th line of myClass.as in the exemple).

Any ideas to perfoms the check without getting the error?

Simon
