A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Scrolling menu on rollover problem.

  1. #1
    Member
    Join Date
    Feb 2007
    Posts
    39

    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;
    }
    };

  2. #2
    Senior Member
    Join Date
    Jun 2009
    Posts
    171
    Somehow add this:
    Code:
    instanceName.enabled = false; //as well as TRUE when necessary

  3. #3
    Member
    Join Date
    Feb 2007
    Posts
    39
    I actually tried that but it didn't work. Anyone else have any ideas??? I am stumped on this..

  4. #4
    Member
    Join Date
    Feb 2007
    Posts
    39
    anyone else? I really need the help, I will paypal if needed.

    Thanks,

  5. #5
    Member
    Join Date
    Aug 2006
    Posts
    56
    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.

  6. #6
    Member
    Join Date
    Feb 2007
    Posts
    39
    I tweaked it using different targets but couldn't seem to get it to work..

  7. #7
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center