The map locationscript does not recognize the button instance name, it calls from the main timeline the instance:
//map location
var justStarted = true;
_root.btn1917.onRollOver = function() {
justStarted = false;
endX = 100;
endY = 50;
xscale = 140;
yscale = 140;
};
_root.btn1932.onRollOver = function() {
justStarted = false;
endX = 50;
endY = 30;
xscale = 100;
yscale = 100;
};
_root.btn1940.onRollOver = function() {
justStarted = false;
endX = 100;
endY = 30;
xscale = 80;
yscale = 80;
};
_root.btn1945.onRollOver = function() {
justStarted = false;
endX = 110;
endY = 50;
xscale = 100;
yscale = 100;;
};
//buttons instance names
buttons_array = ["btn1917", "btn1932", "btn1940", "btn1945"];
//hitareas
btn1917.hitArea = _root.btn1917.ha;
btn1932.hitArea = _root.btn1932.ha;
btn1940.hitArea = _root.btn1940.ha;
btn1945.hitArea = _root.btn1945.ha;
function activeButton() {
for (var i in buttons_array) {
var ref = this._parent[buttons_array*];
if (ref == this) {
holder.loadMovie(movies_array*);
ref.f = "active state";
ref.enabled = false;
} else {
ref.f = "normal state";
ref.enabled = true;
}
ref.gotoAndStop(ref.f);
}
}
for (var i in buttons_array) {
this[buttons_array*].f = "normal state";
this[buttons_array*].onPress = activeButton;
this[buttons_array*].onRollOver = function() {
this.gotoAndPlay("over state");
};
this[buttons_array*].onRollOut = function() {
this.gotoAndPlay("out state");
};
}
I also tried creating a different layer with the buttons containing bigger hitareas, but it worked not good.
You’ll probably get a better picture if you see the fla file.
The fla is uploaded here: nav_map_dbug.rar
Thanks,
Baeshin.