Newsletter: Learn More ||| Multimedia Presentation Software |||
Scrolling Menu with Scrolling Background in Flash MX
Introduction
This mini tutorial shows you how to contruct a scrolling menu with scrolling background in Flash MX.
Contents Download zip file.
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.
 
©2007 Wildform, Inc | Policies | Contact Us | Newsletter Options
 
©2010 Wildform, Inc | Policies | Contact Us | Newsletter Options
 
Wildform provides a 100% satisfaction guarantee on all our Flash software. If you are not completely satisfied with our Flash multimedia software for any reason you may request a refund within 15 days of purchase.