A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: Rollover Effects in a menu

  1. #1

    Hi Gang...

    Been along time since I posted here, I was surprised my login still worked!

    I have a menu bar I'm working on that I thought I better let you guys have a look at before I continue forward, because I'm not sure if I'm using the proper or most efficient methods to accomplish the end result.

    The first version I have is at:

    http://www.readysetinternet.com/swish/topmenu2.swf
    http://www.readysetinternet.com/swish/topmenu2.swi

    In this version I am trying to get the grey rectangle to follow the mouse left and right across the row of links. I got it to move from the first link to the second, but then the effect continues to cycle as you say rolled on the second one. (I havent attempted following the mouse back to the left yet.)

    Second one (alternate version):

    http://www.readysetinternet.com/swish/topmenu4.swf
    http://www.readysetinternet.com/swish/topmenu4.swi

    This alternate version just has the grey rectangle move up as the link is rolled on, then back down on the roll out. I'm not sure why the effect replays as you stay on the link.

    Thanks folks,

    Den
    [Edited by dennism220 on 10-30-2001 at 06:01 PM]

  2. #2
    Member
    Join Date
    Aug 2001
    Posts
    73
    Put a stop in the time line where you want it and just do the same to the others thats all...

  3. #3
    UNified
    Join Date
    Mar 2001
    Location
    Montville QLD
    Posts
    6,161
    Hi Den, welcome back.
    Stick with the top version but take some time to study the method used in theis tutorial. It uses the new TRANSFORM function for tell target and gives that smoooooth move your looking for. Also at the end of the day its a lot simpler to set up.
    Hope you get some value from it.
    http://board.flashkit.com/board/show...hreadid=217338

  4. #4
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900
    I've made your first example simpler and made it work (make sure you've got SWiSH v2 Build 2001.10.16)

    It uses the new Transform Action to move smoothly from position to position. Also turned your buttons into real buttons.

    Note that the smarts are in the actions in the Hilite sprite that tell the Bar sprite to move to a particular position. Each button has a roll-over event that tell the Hilite Sprite to go to the appropriate frame to move the grey bar.

    http://members.dingoblue.net.au/~rog...menu-fixed.swi

    http://members.dingoblue.net.au/~rog...menu-fixed.swf

  5. #5
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    Very nice Roger

  6. #6
    WOW. Much thanks to Jofta for the link to the theory behind the great gift that Roger has offorded me. Now I can really learn WHY this works.

    And you were on the money Jofta, this technique does provide the smooth movement I was looking for.

    Now that gave me the idea of trying to make the grey bar only visible during the rollover. I guess my wife is right...I'm never satisfied...


    Thanks again!

    Den

  7. #7
    Senior Member
    Join Date
    Aug 2001
    Posts
    1,071
    If you use Roger's example, note the 2nd link, "partners", you might want to uncheck the "loop" box for that sprite on the over state. (the others are ok)

    Just an FYI...

  8. #8
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900
    Originally posted by KLTdesigns5869
    If you use Roger's example, note the 2nd link, "partners", you might want to uncheck the "loop" box for that sprite on the over state. (the others are ok)
    Would you believe that was a deliberate "mistake" to see if you were paying attention ??? Guess not

  9. #9
    [QUOTE]Originally posted by roger_onslow

    Would you believe that was a deliberate "mistake" to see if you were paying attention ??? Guess not
    LOL! Actually, I did notice it, but I sure wasn't going to whine about that after the education I just got!

    Thanks again!

    Den

  10. #10
    Swiftdev Founder 98svt's Avatar
    Join Date
    May 2001
    Location
    Royal Oak, Michigan
    Posts
    2,139

    question Roger...

    I am looking for the same thing, after downloading the swi, it makes sense. But I do have a question or two...

    Q: In the transform panel, there are options for alpha, width, height, x and y positions. Under each catagorie, there are options:
    na
    =
    +=
    -=
    *=
    /=

    Can you give me some insight to what these do?
    I know += and -= but the rest.... hmmm.

    Thanks

    Mike

  11. #11
    UNified
    Join Date
    Mar 2001
    Location
    Montville QLD
    Posts
    6,161
    Mike, read my first post on this thread, go to Bruski's tutorial, it will help you understand it .

  12. #12
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900

    Re: question Roger...

    Same as in C, C++, Javascript, ActionScript etc:

    = sets the value to the number specified
    += adds the number to the current value
    -= subtracts the number from the current value
    *= current value is multiplied by the number
    /= current value is divided by the number

    [Edited by roger_onslow on 10-30-2001 at 06:12 PM]

  13. #13
    Swiftdev Founder 98svt's Avatar
    Join Date
    May 2001
    Location
    Royal Oak, Michigan
    Posts
    2,139
    Ah yes, math...my favorite subject...NOT!!!

    I get it, thanks Roger and Jofta!

    Mike

  14. #14
    Which variable would you adjust to change the rate of movement?

    I've been reading thru the tutorial and studying the formula...but I'm not sure...


    Thanks,

    Den

  15. #15
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900
    Originally posted by dennism220
    Which variable would you adjust to change the rate of movement?
    In the example in this thread, the _x*=0.8 controlls the rate. Setting a value closer to 1 makes it go slower (1=no movement), a value closer to 0 makes it go faster (0=jump straight there). If you put in a value >1 or <0, then it will go crazy and fly away.

  16. #16
    Great, at least I know I was on the right track...

    The more I read the tutorial, I began to lose my confidence. Thought I better ask..

    Thanks again!

    Den

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