Easing flash menu

  • andrewmeda
  • Novice
  • Novice
  • User avatar
  • Posts: 15
  • Loc: London

Post 3+ Months Ago

Hello,

I am desparetely trying to make a horizontal easing flash menu, that moves when the user runs their mouse over it.

It is basically the same effect as the link below. This site has a really cool photo viewing gallery that uses the mouse over motion effect.

I jusr want to implement it onto a horizontal menu....

Check out the link, and follow the navigation listed below to check it out.

Any help / advice / code would be really appreciated.

http://www.thedufferofstgeorge.com/

1.launch site
2. hit 'special projects'
3. hit the '20 ans' button / graphic for it to load.

It's really nice!!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ShapeShifter
  • Graduate
  • Graduate
  • User avatar
  • Posts: 159
  • Loc: Sweden

Post 3+ Months Ago

this would require good knowledge of AS.. and lots of patience as well coz you WON'T get it right the first time.. I know coz I've been there :)
do you have what it takes? -_^
  • andrewmeda
  • Novice
  • Novice
  • User avatar
  • Posts: 15
  • Loc: London

Post 3+ Months Ago

Go on, hit me with it! I can take it!

Any advice or code would be great.

Greetings from London!
  • Jaw
  • Graduate
  • Graduate
  • User avatar
  • Posts: 132
  • Loc: Minneapolis, MN

Post 3+ Months Ago

If you were to try and mimic the style I would first start with finding the position of the mouse on the movieclip and then return a percentage.
If the mouse is all the way left or beyond that is 0% and right edge and beyond is 100%.
Same with top to bottom.

Find where the mouse is located and then you will have a percentage value to apply to the position of any other elements.
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

another way to do it is to have the speed of the menu be a function of how far off-center the mouse is... and then just have stop-points...

i did this a while ago for this photographer's site...
i based it off of [url="http://www.tutorio.com/tutorial/simple-flash-xml-photogallery"]this tutorial[/url] and the scroll code was:
Code: [ Select ]
thumbnails.onEnterFrame = function() {
var distance = midx-_root._xmouse;
if(_root.thumbnails._x>=(302.9) && ((Number(distance))>0)){
_root.thumbnails._x = _root.thumbnails._x;}
else if(((Number(_root.thumbnails._x))<=((641.7)-(i*spacing)) && ((Number(distance))<0))){
_root.thumbnails._x = _root.thumbnails._x;}
else{
_root.thumbnails._x += (distance*friction);}
}
  1. thumbnails.onEnterFrame = function() {
  2. var distance = midx-_root._xmouse;
  3. if(_root.thumbnails._x>=(302.9) && ((Number(distance))>0)){
  4. _root.thumbnails._x = _root.thumbnails._x;}
  5. else if(((Number(_root.thumbnails._x))<=((641.7)-(i*spacing)) && ((Number(distance))<0))){
  6. _root.thumbnails._x = _root.thumbnails._x;}
  7. else{
  8. _root.thumbnails._x += (distance*friction);}
  9. }


check out that tut, though... and the thread i posted the scrolling code in is [url="http://www.tutorio.com/forums/showtopic-41.html"]here[/url], i'm puck... yeah...

if you have any questions, come with 'em...
  • R.L.D.
  • Student
  • Student
  • User avatar
  • Posts: 83
  • Loc: Astoria,Queens

Post 3+ Months Ago

or if you want something a little more simple you could use something like this...

Code: [ Select ]
onClipEvent (enterFrame) {
    if(this.hitTest(_root._xmouse,_root._ymouse,true)){
        _root.player._y += (14 - _root.player._y)/2;
    }else{
         _root.player._y -= (0 + _root.player._y)/2;
    }
        
}
  1. onClipEvent (enterFrame) {
  2.     if(this.hitTest(_root._xmouse,_root._ymouse,true)){
  3.         _root.player._y += (14 - _root.player._y)/2;
  4.     }else{
  5.          _root.player._y -= (0 + _root.player._y)/2;
  6.     }
  7.         
  8. }


check out http://www.myspace.com/rldesigns to see the code in action...
mouse over the mp3 player on top.

code goes on the movieClip that you want to slide.

_y is obviously the angle you want to slide.
14 would be the distance
2 would be the speed

hope that helps :)
  • andrewmeda
  • Novice
  • Novice
  • User avatar
  • Posts: 15
  • Loc: London

Post 3+ Months Ago

Thanks guys - VERY MUCH APPRECIATED!

Will give them a crack and let you know how I get on.

Thanks again.

andrew_meder
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

R.I.D.,

that's nice, man... much more elegant than my scrappy code...
pretty tight that there's always more than one way to... um... peel an orange? (the cat thing's just kinda nasty)

peace out
  • braxius
  • Born
  • Born
  • braxius
  • Posts: 2

Post 3+ Months Ago

this is what you get when you ask a help from a hardcore AS'esr, they al seem to know how to do it, but none of them can tell how.

A hardcore coder would write millions of code lines and waste lots of time on this, well heres how a smart programmer would to it.

function initScroll() {
this.onEnterFrame = function() {
if (Mask_mc.hitTest(_root._xmouse, _root._ymouse)) {
var Items_mc = _root.target_mc
var position = _root._xmouse-this._x-15;
var visibleWidth = Mask_mc._width-15;
var allWidth = Items_mc._width-matomas;
var stepA = allWidth/visibleWidth;
var needsToBeHere = 10-(Mask_mc._x+(position*stepA));
if (needsToBeHere<-(allWidth-15)) {
needsToBeHere = -(allWidth-15);
}
if (needsToBeHere>10) {
needsToBeHere = 10;
}
var isHere = Items_mc._x;
new mx.transitions.Tween(Items_mc, "_x", mx.transitions.easing.Elastic.easeOut, isHere, needsToBeHere, 3, true);
}
};
}

There are quite a lot of things that i learned in my 5 years of flashing, and one of those things is that, when you have written more that 30 lines of code for a simple looking action- delete it and start using F1 to find alternative
  • andrewmeda
  • Novice
  • Novice
  • User avatar
  • Posts: 15
  • Loc: London

Post 3+ Months Ago

Thanks a lot for that - will certainly give it a go.

All the best.
  • Dima85
  • Newbie
  • Newbie
  • Dima85
  • Posts: 10

Post 3+ Months Ago

andrewmeda wrote:
Thanks a lot for that - will certainly give it a go.

All the best.


You can use some online or desktop menu creator.
Like that one: http://flash-menu.net it's online
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

dude you found a 2 year old thread. I assume the problem has been solved...

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 16 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.