[Flash8] invisible button rollover and _xmouse/_ymouse coordinates

I am an Actionscript beginner, though…

I created a map which can be moved up, down, left, and right. On the map are invisible buttons. When the mouse moves over an invisible button, a movie clip appears like a pop up info sign, doesn’t matter where I moved the map earlier. All this I accomplished by using this actionscript:

//-----ALL INVISIBLE BUTTONS LOCATED WITHIN MAPMIDSIZE_MC-----//
mgold_mc._visible = false;
mapmidsize_mc.mgoldInv_btn.onRollOver = function() {
mgold_mc._visible = true;
mgold_mc._x = _xmouse-150;
mgold_mc._y = _ymouse-50;
};
mapmidsize_mc.mgoldInv_btn.onRollOut = function() {
mgold_mc._visible = false;
};
//-----------------END--------------------//

So in general, it works, but…

The problem: the “pop-up sign” named mgold_mc appears in slightly different spots, depending on where I “enter” [start to move my mouse over the “active/hot spot”] the invisible button mgoldInv_btn.

Question: How can I make sure that mgold_mc appears in the same, EXACT spot?

Well the reason it is appearing in slightly different spots depending on where you rollOver it is right in your code


mapmidsize_mc.mgoldInv_btn.onRollOver = function() {
    mgold_mc._visible = true;
    mgold_mc._x = _xmouse-150;
    mgold_mc._y = _ymouse-50;
};

You have the X property set to show up wherever your mouse is minus 150px and the Y property set to wherever your mouse is minus 50 so of course it will change locations.

What you can do is something more or less what you have:


mapmidsize_mc.mgoldInv_btn.onRollOver = function() {
    var xPosition = 150;
    var yPosition = 50;
    mgold_mc._visible = true;
    mgold_mc._x = xPosition;
    mgold_mc._y = yPosition;
};

then just change those variables accordingly.

Thank you! - I tried the suggested actionscript earlier. That certainly fixed the “jumping”, slightly different locations of the movieclip mgold_mc when I rollover the invisble button mgoldInv_btn… but keep in mind, the map mapmidsize_mc on which this invisible button is located could be in a different position depending on what the webuser scrolled to! The code I posted with my question allows the mgold_mc to appear where it should, except of course with the problem I described: slightly different spots. - It must have to do with the shape of the invisible button maybe? I used a square and also tried a circle (makes no difference). I also tried a making the invisble button as small as possible, which helps out with the “jumpyness” of the mgold_mc, but makes it harder for the webuser to be able to “hit” the hot spot when rolling over it with his mouse. - Further suggestions that can help me out? I am stuck for three days now.