Skip to main content
May 28, 2009
Answered

Very Easy Question...

  • May 28, 2009
  • 1 reply
  • 515 views

so i have a mc. say myMc. On this mc, i have this code:

onClipEvent(load){

     this._x= 0;

     this._y= 0;

Stage.addListener(this)
    this.onResize=function(){
        this._x= 0;
        this._y= 0;
    }
}

If i want to put the code on the timeline instead of on the mc, how would i write it?

This topic has been closed for replies.
Correct answer kglad

myMc._x= 0;

myMc._y= 0;

var lo:Object={};

Stage.addListener(lo)
lo.onResize=function(){
        myMc._x= 0;
        myMc._y= 0;
    }
}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 28, 2009

myMc._x= 0;

myMc._y= 0;

var lo:Object={};

Stage.addListener(lo)
lo.onResize=function(){
        myMc._x= 0;
        myMc._y= 0;
    }
}

May 29, 2009

Thanks!

However, it didnt work, but for some other reasons... Anyways i wont use it. But at least now i know;)

kglad
Community Expert
Community Expert
May 29, 2009

you're welcome.