A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [CS3] Horizontal Scrolling Menu Nightmate Please Help!

  1. #1
    Senior Member jerryday's Avatar
    Join Date
    Mar 2002
    Posts
    154

    [CS3] Horizontal Scrolling Menu Nightmate Please Help!

    I am having trouble making a menu that will scroll horizontally and loop around seamlessly. I have 15 buttons which I placed into a movie clip and dragged an instance onto the main timeline named menu_mc. I then put this code on the main timeline.

    Code:
    stop();
    
    
    _root.onEnterFrame = function() {
    	menu_mc._x = menu_mc._x + (0.5 * Stage.width - _root._xmouse) / 70;
    };
    This slides around fine but now I have two problems.

    1 I can't figure out how to make it loupe and I can't make it stop moving when a button is rolled over.

    The effect I am going for is similar to the sliding nav here http://www.wynnlasvegas.com/

    Thanks for any help that you can give
    – Jerry

  2. #2
    Senior Member
    Join Date
    Mar 2000
    Posts
    116
    Okay.. couple of ways you can do this.. You are actually going to need 2 copies of your menu movie. Because at some point you will need to have both the beginning and the end of your menu appear even if it is longer then the screen..

    Example:


    |<-- Stage width -->|
    |<--- Menu width --->|

    At some point you will have something like this..
    |<-- Stage width -->|
    .........|<--- Menu width --->|

    With the way you have your menu setup you will need it to repeat..

    ...............|<-- Stage width -->|
    |<--- Menu width --->||<--- Menu width --->|

    Now here is a trick with this type of menu.. You are going to need to move the off screen menu to the right side of the showing menu.. if your menu is scrolling to the left.. then before the right edge of the visible menu passes the left side of the stage, you will need to have your offscreen menu in place.. Not sure this is going to line up right.. but here is what i am talking about..

    If your menu is moving left.. then at this point..

    ...|<-- Stage width -->|
    |<--- Menu width --->| <<< menu is moving left

    Then you are going to need to place the off screen menu on the right side of the stage to take over..

    .....|<-- Stage width -->|
    |<--- Menu width --->||<--- Menu width --->|

    Like wise you would have to do the same thing if scrolling right.. but you would place the current off screen menu on the left of the current visible menu..

    I would do this check as part of your function.. Calculate where the movie will be before you move it and then decide if you need to reposition the off screen menu.

    Now for the second part.. I am not sure I would do the main animation as an onEnterFrame.. but let's roll with it anyway..

    Replace the onEnterFrame function on mouse over of any of the menu items. Then put it back onDragout, onReleaseOutside..

    I hope that helps..

    And just an fyi.. when using Stage.width, the Flash development player (ctrl+enter) won't report the correct size if you modify size of the browser.. it will always return the value of the compiled size rather then the current size of the stage. This isn't the case in a browser.. /shrug

    hope that helps.. l8r..

    [EDIT] Spaces didn't show up for the examples.. i edit the post to use periods to correct the alignment issues on the examples.
    Last edited by @; 03-10-2008 at 12:22 PM.
    Webpages:

    www.winningsolutionsinc.com

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