Newsletter: Learn More ||| Multimedia Presentation Software |||

« Wildform helps make ordinary Web sites dance | Chicago Tribune | Main | "Your software can't be beat" »

Scrolling Menu

This has always been popular on our site, so I thought I'd share it here.

This mini tutorial shows you how to construct a scrolling menu with scrolling background in Flash MX.




STEP ONE

Set the frame properties Size: 420 X 90 pixels. Frame Rate: 25 Fps.

STEP TWO

Import a background picture. I made the background picture in photoshop, size 700 X 85.

STEP THREE

Select the background picture and convert it to a movie clip. Give name bg_static.

STEP FOUR

Give this an instance name of bg.

STEP FIVE

Create the menu movieclip. size 1045 X 40.

STEP SIX

Give this an instance name of menu.

STEP SEVEN

Select the first frame and give action:

xm = 0;
//function to set the xpos of the movieclip
function xpos(bar_length,mul)
{
hpos = 0;
scroll_length = 420;
incr = bar_length/scroll_length;
xm = _xmouse;
if(_xmouse <= 10){xm = 10;}
if(_xmouse >= 400){xm = 400;}
scroll_x = hpos - xm;
scroll_x = scroll_x * mul;
x_pos = scroll_x * incr;
x_pos = x_pos + hpos;
return x_pos;
}

_root.onEnterFrame = function ()
{
// call function xpos
x_pos = xpos(700,.20);
with (bg)
{
_x += (x_pos - _x)*.4;
}
// call function xpos
x_pos = xpos(950,.75);
with (menu)
{
_x += (x_pos - _x)*.4;
}
}

STEP EIGHT

Test the movie.

This article was first published by www.internetcross.com.

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please enter the security code:



 
©2007 Wildform, Inc | Policies | Contact Us | Newsletter Options
 
Wildform provides a 100% satisfaction guarantee on all our software. If you are not completely satisfied with our software for any reason you may request a refund within 15 days of purchase.