This code can be use in both AS1 and AS2. The thing made mistake is a capital Y.
Code:
onClipEvent (enterFrame) {
Xsquare = _root.maincontainer.mapmc._x;
Xdiff = Xpos-Xsquare;
Xmove = Xdiff/12;
_root.maincontainer.mapmc._x = Xsquare+Xmove;
Ysquare = _root.maincontainer.mapmc._y;
Ydiff = Ypos-Ysquare;
Ymove = Ydiff/12;
_root.maincontainer.mapmc._y = Ysquare+Ymove;
updateAfterEvent(enterFrame);
}
and now the code for a button
on (release) {
_root.maincontainer.mapmc.Xpos = 1670;
_root.maincontainer.mapmc.Ypos = 1700;
}
arkitx