Hi, I modified a gallery component that I purchased, and need help with mouse detection in scrolling. Basically, I moved the “menu” thumbnails from a vertical alignment/scroll to a horizontal alignment/scroll at the bottom of the stage. Everything works great, except the mouse is detected anywhere on the screen. Meaning, if i move the mouse left to right at the top of the screen, the thumbnails at the bottom still move. I need it to detect the mouse only when the mouse is positioned above the thumbails/menu. Hope this makes sense. Below is the script from the file I’ve update. Anyone can point out where I made an error, would really appreciate it!
//BUTTON FUNCTION: GET URL
this.image_mc.bttn.onRelease = function() {
getURL(launchLink, “_blank”);
};
//ON THUMBNAIL PRESS FUNCTION (LOAD LARGE IMAGE)
clickAction = function (obj) {
this.image_mc.holder._alpha = 0;
loadMovie(image[obj.ID], this.image_mc.holder);
launchLink = url[obj.ID];
txt_mc.txt.text = full_txt[obj.ID];
};
// INITIAL VARIABLES (ADJUST MENU SPACING AND SCROLL BUFFER HERE)
var menuSpacing = 1;
var menuWidth = this.menu_mc.image_mc._width+menuSpacing;
var boundryHeight = mask_mc._height;
var boundryWidth = mask_mc._width;
var buffer = (menuWidth)*10;
// INITIAL MOVIECLIP SETTINGS
menu_mc.setMask(mask_mc);
hover_mc.startDrag([lockCenter]);
hover_mc._visible = false;
txt_mc._visible = false;
// LOAD FIRST IMAGE / COPY ON STARTUP
loadMovie(image[0], this.image_mc.holder);
launchLink = url[0];
txt_mc.txt.text = full_txt[0];
//BUILD THUMBNAIL MENU BASED ON XML DATA
for (i=0; i<total; ++i) {
this.menu_mc.image_mc.duplicateMovieClip(“image_mc”+i, i);
this.menu_mc[“image_mc”+i]._x = (menuWidth)*i; //this.menu_mc[“image_mc”+i]._y = (menuHeight)i;
loadMovie(thumb, this.menu_mc[“image_mc”+i].holder);
this.menu_mc[“image_mc”+i].ID = i;
}
//SCOLLING MENU SCRIPT (DETECT MOUSE POSITION)
this.onMouseMove = function() {
if (this._xmouse>0 && this._xmouse<boundryWidth) {
if (this._xmouse>0 && this._xmouse<boundryWidth) {
ratio = this._xmouse/boundryWidth;
diff = menu_mc._width-boundryWidth+buffer;
destX = Math.floor(-ratio*diff)+buffer/2;
}
}
};
this.onEnterFrame = function() {
//SHOW AND HIDE COPY TEXT ON IMAGE ROLLOVER
if (image_mc.holder.hitTest(_parent._xmouse, _parent._ymouse, true)) {
txt_mc._visible = true;
txt_mc.txt._height = txt_mc.txt.textHeight+5;
txt_mc.bg._height = txt_mc.txt._height+20;
txt_mc._x = image_mc._width-txt_mc._width;
txt_mc._visible = true;
} else {
txt_mc._visible = false;
}
//SCOLLING MENU SCRIPT (SCROLL EASING)
menu_mc._x += (destX-menu_mc._x)/5;
if (menu_mc._x>0) {
menu_mc._x = 0; } else if (menu_mc._x<(boundryWidth-menu_mc._width)) {
menu_mc._x = boundryWidth-menu_mc._width;
}
};
stop();