A trace cannot effect anything in your work. It just shows you that what your trying to do is working. Other stuff too..... lol. But cant effect your game, gameplay-wise. So you did something else to get that error.
Printable View
A trace cannot effect anything in your work. It just shows you that what your trying to do is working. Other stuff too..... lol. But cant effect your game, gameplay-wise. So you did something else to get that error.
well using trace, and still checking for when mouse x and y hit that point, works and doesn't work. It works in the sense that there are no errors. But it doesn't work as in when your mouse x and y hit that point, nothing happens
Listen Kraxyk, You're checking for the mouse to hit ONE PIXEL rather than the entire area of the green square! :
if (mousex == 30 && mousey == 54)
30,54 is the location of ONE pixel. (And by the way, I personall would put it like this: if ((mousex == 30) && (mousey == 54)), but that's not the issue here really.
Add this immediately before that IF statement:
trace(mousex+","+mousey);
Now Test Movie and watch the output box. It will show your mouse cursor coordinates in real time. See how there is a wide variety of values when the cursor is over the green box?
this is what I did. copy and past in frame 5's actions
I know I made this code a little long, but you put code into MovieClips. I wanted to us the onRollOver but ,you have a on(RollOut) in the black L shaped Movie Clip. This code will allow you to do what your trying to do.Code://store some temporary variables
stop();
var didHitStart:Boolean = false;
onEnterFrame = function () {
if (didItHit(start)) {
didHitStart = true;
}
if (didHitStart && didItHit(end)) {
_root.gotoAndStop(7);
}
};
didItHit = function (m:MovieClip) {
if (m._xmouse<=m._width/2 && m._ymouse<=m._height/2) {
return true;
} else {
return false;
}
};
Just delete the code in frame 5 and replace it with what I put above. Remember or start to put all your code in the a Frame not a Movie Clip. I not trying to fix your game I'm just trying to get you past a hump you can't get over. LOL I put "hump".