damm. det opfører sig mærkeligt.. kan i se hvorfor ?
(
http://www.internetstatistik.dk/map4.swf )
onClipEvent (load) {
destination_x = _x;
destination_y = _y;
move = 12;
}
onClipEvent (mouseDown) {
destination_x = _root._xmouse;
destination_y = _root._ymouse;
}
onClipEvent (enterFrame) {
bredde = 550;
// sæt bredden af filmen her
hojde = 400;
// sæt højden af filmen her
speed = 1/15;
// sæt hastigheden her
this._x -= speed*(_root._xmouse-bredde/2);
this._y -= speed*(_root._ymouse-hojde/2);
fromX = destination_x;
fromY = destination_y;
temp_x = _x-fromX;
temp_y = _y-fromY;
strTarget = -Math.atan2(temp_x, temp_y);
if (Math.sqrt((temp_x*temp_x)+(temp_y*temp_y))>move) {
_y -= move*Math.cos(strTarget);
_x += move*Math.sin(strTarget);
}
}