If statement then gotoAndPlay

Hello,

I would like some help on writing a piece of code.

I need to write a function that if some movie clips are in some x and y value, then gotoAndPlay(β€˜end’);

please advice.



function gotoEnd() {
    if 
         (tv_mc._x = 41.8;
         tv_mc._y = 157.3;)
    then
         gotoAndPlay('end');
}

:ear: