# Targetting problem in class (Component)

**URL:** https://forum.kirupa.com/t/targetting-problem-in-class-component/253358
**Category:** flash
**Created:** [February 29, 2008, 2:16pm UTC](https://forum.kirupa.com/t/targetting-problem-in-class-component/253358 "2008-02-29T14:16:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Chefi](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@Chefi](https://forum.kirupa.com/u/Chefi)
#### Post date: [February 29, 2008, 2:16pm UTC](https://forum.kirupa.com/t/targetting-problem-in-class-component/253358/1 "2008-02-29T14:16:03Z")

</div>

So here we go. I’m kind of a stuck on creating AS2 component. Its my first one and I think thats probaply the reason im stuck in this stubid situation. 😛

So lets move to the point. I have created Mouse listener which is working fine, only thing I just cant understand is how can I target to something inside of the listener when event is launched from it.

Heres a small example:

```auto
Class ..... extends MovieClip {

    var changeMe:Number;

    var theListener:Object = new Object();
   

    function constructor(){
         createMouseEvents();
    }

    function createMouseEvents() {
         Mouse.addListener(theListener);

         theListener.onRelease = function(){
               // Here comes the problem
               // For example im trying to give "changeMe" variable a new value
               // but i cant target it.

               changeMe = 10; // no luck
               this._parent.changeMe = 10; // no luck

               trace(this); // Equals to: [object Object] thats correct
               trace(_parent); // Equals to: undefined
               trace(this._parent) // Equals to: undefined

         }   
    }
} // class ends

```

I hope I just havent missed anything cause im getting tired with this. I dont know are there other threads about this cause I cant get in my mind any search words for this.

Thanks in advance. Ill hope heres some AS hero (I know heres many). :pope:

And btw. love your tutorials. User them alot when I started with Flash and AS. :thumb2:
