# \[AS2\] Self Reference to a class instance within a class

**URL:** <https://forum.kirupa.com/t/as2-self-reference-to-a-class-instance-within-a-class/75292>\
**Category:** flash\
**Created:** [January 7, 2005, 1:27pm UTC](https://forum.kirupa.com/t/as2-self-reference-to-a-class-instance-within-a-class/75292 "2005-01-07T13:27:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blue\_chi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/blue_chi/32/62_2.png) [@blue\_chi](https://forum.kirupa.com/u/blue_chi)\
**Post date:** [January 7, 2005, 1:27pm UTC](https://forum.kirupa.com/t/as2-self-reference-to-a-class-instance-within-a-class/75292/1 "2005-01-07T13:27:03Z")

</div>

Hello people!

The question says it, how can I self refer to an instance of a class within the class definition file?

Here is an example

```php
public function fireBullet(target:MovieClip) {
		Bullet_mc = target.attachMovie("Bullet", "Bullet1", 1);
		}
	}

```

Now everytime I want to call the function I have to put _this_ as my target, (_fireBullet(this)_)I cannot just put it in the code as it gives me an error. Could someone please help.
