View Single Post
Old 02-09-2003, 02:01 PM   PM User | #5
oat
New Coder

 
Join Date: Feb 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
oat is an unknown quantity at this point
hi,
in effect, this navigation is basically a "loose" scrollbar.. i.e. it works in the same way as a scrollbar but the object being scrolled isnt constrained on the x axis.

As I see it, there are two ways of doing this.. The first, the sloppy way is to drag your scroller clip (several ways to do this in flash), and constrain to the particular area. startDrag() as mouse says is the best way of dragging, you can set the boundaries of the drag as parameters. Now, the only potentially tricky part to this is obtaining the ratio with which to scroll the other clip. i.e. 2ndclip._x=-1stclip._x*ratio; indicating how much to scroll the second clip relative to the first (e.g. 2:1 pixels). You need this ratio to make sure the second clip doesnt scroll too much or too little. Why i said "sloppy method" as the first is that you can use trial and error the obtain the ratio, or you can calculate it based on the sizes of 1)draggable clip, 2)visible scroll area, 3)size of second clip (the "proper way"). Off the top of my head, this equation is something like:
Code:
posn of content clip = currentdragclipposn*-((underclipsize-visiblescrollarea)/(visiblescrollarea-dragclipsize));
where underclipsize is the size of your content clip, currentdragclipposn is the position of your draggable clip visible scrollarea is the scroll area size, and drag clipsize is the size of the scroller clip. Note you would need to do this in both x and y coordinates of course.
like i say this may be slightly wrong, but u get the idea.

so, you can either spend time messing about with this stuff (if you do get this figured out you will have obtained a pretty decent knowledge of flash), or as ionsurge suggests, visit www.flashkit.com, somebody will have done this before..

hope this helps

oat
__________________
UK web design & development
http://www.luminate.org.uk/
oat is offline   Reply With Quote