A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Wannabee Trendy Menu

  1. #1
    Tomatos
    Join Date
    Aug 2001
    Location
    Vejle, Denmark
    Posts
    85

    Smile

    Hi,
    I´m looking for a nice menu made in flash and have discovered one at http://www.skybrud.dk and would like to know, if anyone knows how to make the effect when you mouseover the buttons. Take a look at http://www.skybrud.dk - it´s a nice effect. Hope anyone knows how to make this effect - wodering if it´s made with actionscripting...??

    Thanks,
    Thomas

  2. #2
    madskool.wordpress.com brutfood's Avatar
    Join Date
    Apr 2002
    Posts
    469
    You like that? I've have to include a button like that in my drag and drop WEB designer then: http://au.geocities.com/brutfood/

    Two things going on, the first is along the lines of:-

    xdistance=_xmouse-mybutton._x;
    ydistance=_ymouse-mybutton._y;
    distance=Math.sqrt(xdistance*xdistance+ydistance*y distance);
    if (distance<threshold) {
    mybutton._xscale=100+distance*xgrowthfactor;
    mybutton._yscale=100+distance*ygrowthfactor
    }

    Play around with constants threshold, xgrowthfactor and ygrowthfactor. You may want to normalise (divide) the growthfactors by threshold to make playing around easier.

    The other thing is something like:-

    on (rollover) {_parent.mybutton.swapDepths(100)}

    This code is just for illustration purposes only - you will write it differently, because you will set up a loop that alters all the buttons. But this is your starting point anyway.

  3. #3
    madskool.wordpress.com brutfood's Avatar
    Join Date
    Apr 2002
    Posts
    469
    Funny things happen when you don't put code tags around code in these threads.

    Half a statement vanished that checked if distance was less than threshold.

  4. #4
    madskool.wordpress.com brutfood's Avatar
    Join Date
    Apr 2002
    Posts
    469
    Doh!

    And the Homer Simpson stupidity Award goes to Daniel Freeman, (alias Brutfood), previously innovator and world class DSP expert. Now reduced to filling Flashkit forums with stupid code that does the opposite to what you want. Definitely going Senile!

    Sorry about that, at least I realised my blunder. What I wrote before was the incredible shrinking buttons - not amazing growing ones.

    Lets have another go shall we:-

    Code:
    xdistance=_xmouse-mybutton._x; 
    ydistance=_ymouse-mybutton._y; 
    distance=Math.sqrt(xdistance*xdistance+ydistance*ydistance)/threshold; 
    if (distance<1) {
    mybutton._xscale=100+(1-distance)*xgrowthfactor; 
    mybutton._yscale=100+(1-distance)*ygrowthfactor 
    }
    Ok, that's as close as we get without me trying in real Flash MX, not the simulator in my head.

  5. #5
    madskool.wordpress.com brutfood's Avatar
    Join Date
    Apr 2002
    Posts
    469
    Funny things happen when you don't put code tags around code in these threads.

    Half a statement vanished that checked if distance was less than threshold.

  6. #6
    madskool.wordpress.com brutfood's Avatar
    Join Date
    Apr 2002
    Posts
    469
    You like that? I've have to include a button like that in my drag and drop WEB designer then: http://au.geocities.com/brutfood/

    Two things going on, the first is along the lines of:-

    xdistance=_xmouse-mybutton._x;
    ydistance=_ymouse-mybutton._y;
    distance=Math.sqrt(xdistance*xdistance+ydistance*y distance);
    if (distance<threshold) {
    mybutton._xscale=100+distance*xgrowthfactor;
    mybutton._yscale=100+distance*ygrowthfactor
    }

    Play around with constants threshold, xgrowthfactor and ygrowthfactor. You may want to normalise (divide) the growthfactors by threshold to make playing around easier.

    The other thing is something like:-

    on (rollover) {_parent.mybutton.swapDepths(100)}

    This code is just for illustration purposes only - you will write it differently, because you will set up a loop that alters all the buttons. But this is your starting point anyway.

  7. #7
    there is a tutorial on that effect called how to build a tsunami here: http://66.70.72.50//forum/tutorials/tsunami/index.html

  8. #8
    Tomatos
    Join Date
    Aug 2001
    Location
    Vejle, Denmark
    Posts
    85

    Thanks a lot

    Hi there,
    Thanks a lot for helping me out with this one. I´ll try to make these buttons at once :-)

    Thanks a lot,
    Thoms

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