-
Scrolling menu on rollover problem.
Hi all. I have a scroll over menu that works great (see code below) But I only want it to work when I scroll over the menu. Right now, it activates and scrolls even when I'm not hovering over the menu. My canvas is about 800x400 and the scroll over menu is only 200x350. I tried: on rollover disable but that did not work.
Any ideas? Thanks,
stop();
ym = 5;
//function to set the xpos of the movieclip
function ypos(bar_length, mul) {
hpos = 0;
scroll_length = 140;
incr = bar_length/scroll_length;
ym = _ymouse;
if (_ymouse<=80) {
ym = 80;
}
if (_ymouse>=200) {
ym = 200;
}
scroll_y = hpos-ym;
scroll_y = scroll_y*mul;
y_pos = scroll_y*incr;
y_pos = y_pos+hpos;
return y_pos;
}
_root.onEnterFrame = function() {
// call function xpos
y_pos = ypos(600, .20);
with (bar) {
_y += (y_pos-_y)*.4;
}
// call function xpos
y_pos = ypos(208, .75);
with (menu) {
_y += (y_pos-_y)*.3;
}
};
-
Somehow add this:
Code:
instanceName.enabled = false; //as well as TRUE when necessary
-
I actually tried that but it didn't work. Anyone else have any ideas??? I am stumped on this..
-
anyone else? I really need the help, I will paypal if needed.
Thanks,
-
Just a hunch,
but I believe you might need to have an object you're referencing with your parameters. For example, the "_ymouse" should probably "_root._ymouse" and the "_y" should be "this._y", or whatever you want to reference.
-
I tweaked it using different targets but couldn't seem to get it to work..
-
1) please do not offer paiement -> read this forum guidelines.
2) you didn't provide the code that triggers the action. But i'm guessing you don't have it triggered by a button that would limit the hit area where the action is set.
I see 2 options. Modify the code to be function you'd call in an onRollOver or place the loop (the onEnterframe) inside a button handler:
button. onRollOver = function() {
//_root.onEnterFrame.. etc.
};
gparis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|