# How to substitute "this" in here

**URL:** <https://forum.kirupa.com/t/how-to-substitute-this-in-here/323247>\
**Category:** Uncategorized\
**Created:** [June 22, 2011, 11:46am UTC](https://forum.kirupa.com/t/how-to-substitute-this-in-here/323247 "2011-06-22T11:46:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joselalupa](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@joselalupa](https://forum.kirupa.com/u/joselalupa)\
**Post date:** [June 22, 2011, 11:46am UTC](https://forum.kirupa.com/t/how-to-substitute-this-in-here/323247/1 "2011-06-22T11:46:39Z")

</div>

hi, i have these lines of code, when i try them alone it works fine but when i try to use it in my project it stop working, the rotation actually and is because of “this” in the tweener.

```auto
import com.greensock.*

    var myMC:MovieClip = new MovieClip();
    myMC.graphics.beginFill(0x00ff00);
    myMC.graphics.drawRect(0, 0, 400, 300);
    myMC.graphics.endFill();
    myMC.x = myMC.y = 00;
    addChild(myMC);
var targetRotation:int = 0;
var currentRotation:Number = myMC.rotation;

myMC.addEventListener(MouseEvent.MOUSE_DOWN, drag);
function drag(e:MouseEvent) {
   myMC.startDrag();
   this.stage.addEventListener(MouseEvent.MOUSE_UP, drop);
}

function drop(e:MouseEvent) {
   this.stage.removeEventListener(MouseEvent.MOUSE_UP, drop);
   myMC.stopDrag();
   myMC.x = myMC.y = 00;
}

this.addEventListener(Event.ENTER_FRAME,myFunction);
function myFunction(event:Event) {
   if (myMC.x != 0) {
      targetRotation += myMC.x / 60;
      TweenMax.to(this, 5, {currentRotation:targetRotation, onUpdate:applyRotation});
   }
}
function applyRotation():void {
   myMC.rotation = currentRotation;
}

```

my question is, is there any way to reference another object in the tweener to make this thing works? project consist in several classes wich are called by a fla to ensamble interface, maybe that’s the reason it stop working. thanks a lot i n advance for any help.

now i noticed the code i have just works directly on the fla, if i place it in a clase it stop working because of the same…“this”
