barklund, det virker vist ik helt perfekt.
barklund, det virker vist ik helt perfekt. Funktionen virker men, når den reset pil2_mc, så virker pil_mc ikke korrekt, den kan ikke finde udad at dreje de rigtige grader.function rotateTo (d) {
onEnterFrame = function() {
if (pil_mc._rotation != d) {
pil2_mc._rotation = pil_mc._rotation += 10;
} else {
if (d != 0) setInterval(resetPil2, 1000);
delete this.onEnterFrame;
}
};
};
function resetPil2 () {
onEnterFrame = function() {
if (pil2_mc._rotation != 0) {
pil2_mc._rotation += 10;
} else {
delete this.onEnterFrame;
}
};
};
nord_mc.onRelease = function() {
rotateTo(180);
};
syd_mc.onRelease = function() {
rotateTo(0);
};
oest_mc.onRelease = function() {
rotateTo(-90);
};
vest_mc.onRelease = function() {
rotateTo(90);
};nordvest_mc.onRelease = function() {
rotateTo(-130);
};
nordoest_mc.onRelease = function() {
rotateTo(130);
};
sydoest_mc.onRelease = function() {
rotateTo(30);
};
sydvest_mc.onRelease = function() {
rotateTo(-30);
};
