Alright, this is probably something thats solved verry easy, but I tried all kinds of google terms etc and I can't find a solution.
On my stage, I have a symbol, in this symbol (button) the following code:
Code:
on(press)
{
startclick = 1;
}
on(release)
{
if(startclick == 1)
{
// Scale to a sector
_root.map._xscale2 = 100;
_root.map._yscale2 = 100;
// Move the map
_root.map._x = _root.mapmaskleft-this._x;
_root.map._y = _root.mapmasktop-this._y;
}
}
Now, the
// Move the map
_root.map._x = _root.mapmaskleft-this._x;
_root.map._y = _root.mapmasktop-this._y;
Is the important bit. Whenever this code is executed, flash
doesn't take the coördinates of the symbol this is running on,
but the coördinates of the stage the symbol is on.
From the documentation, the this keyword is doing exactly that, so it's working properly. I just need the _x and _y of the symbol this code is running. The symbol doesn't have an instance name because I don't want that because I need to copy it a few dozen times and editing the code in each
instance is a hell of a lot of work.
Is there a solution for this without giving the symbol and instance name and getting the _x and _y trough this intance name?