Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how is this "wave" menu made? 2

Status
Not open for further replies.

goaganesha

Programmer
Dec 4, 2001
178
BE
Hello,
please visit
enter -> continue -> then pick 3d illustration portfolio.

When you move your mouse over the portfolio items, some kind of wave is being made. Does anyone know the principle to make such an effect. Is it a transparent mc which is being dragged over the items?
I don't need a full description on how to make it, just want to know the principle.
All tips are welcome.

regards, goaganesha
 
I've seen a tutorial on this exact same menu! I'd even bet I have it downloaded somewhere on my machine, but I have picked up so many files in this last year, I simply can't find it. If I do I'll post it, but maybe you could e-mail this guy... He may give you a link to it!

Regards,
wink4.gif
ldnewbie
 
Thanx for your reply, oldnewbie
I'll email him for the link and I'll post here it as soon as I get a reply. In the mean time, if you find it, feel free to post it.
regards, goaganesha
 
Not sure if his is done the same way but here's what I came up with...


It's all in one clip and uses the position of the mouse relative to the clips (I couldn't be bothered to type in a load of text so you've got rectangles instead) to calculate how much to resize them by. The code isn't particularly efficient ( for instance you can trip it up pretty easily by moving the mouse really fast) but I didn't have much time.

The script is:


onClipEvent (load) {
// set up
spacer = 24;
total = 15;
max = 170;
min = 100;
for (i=1; i<=total; i++) {
// place clips on the stage
_root.text.duplicateMovieClip(&quot;text&quot;+i, i);
clip = _root[&quot;text&quot;+i];
clip._x = 20;
clip._y = i*spacer;
clip._alpha = 50;
clip._xscale = clip._yscale=100;
}
}
onClipEvent (enterFrame) {
if (_root._xmouse<150 && _root._xmouse>0 && _root._ymouse>20 && _root._ymouse<380) {
// expand clips
for (i=1; i<=total; i++) {
clip = _root[&quot;text&quot;+i];
size = max-(Math.abs(clip._y-_root._ymouse));
if (size>min) {
clip._xscale = clip._yscale=size;
clip._alpha = size-50;
}
}
} else {
for (i=1; i<=total; i++) {
// reduce clips
clip = _root[&quot;text&quot;+i];
if (clip._xscale>min) {
clip._xscale--;
clip._yscale--;
clip._alpha--;
}
}
}
}
 
Thanx wangbar,
one star comming up ;-)
regards, goaganesha
 
Bug fixed -here's the updated code.

onClipEvent (load) {
// set up
spacer = 24;
total = 15;
max = 170;
min = 100;
for (i=1; i<=total; i++) {
// place clips on the stage
_root.text.duplicateMovieClip(&quot;text&quot;+i, i);
clip = _root[&quot;text&quot;+i];
clip._x = 20;
clip._y = i*spacer;
clip._alpha = 50;
clip._xscale = clip._yscale=100;
}
}
onClipEvent (enterFrame) {
if (_root._xmouse<150 && _root._xmouse>0 && _root._ymouse>20 && _root._ymouse<380) {
// expand clips
for (i=1; i<=total; i++) {
clip = _root[&quot;text&quot;+i];
size = max-(Math.abs(clip._y-_root._ymouse));
if (size<min) {
size = min;
}
clip._xscale = clip._yscale=size;
clip._alpha = size-50;
}
}
for (i=1; i<=total; i++) {
// reduce clips
clip = _root[&quot;text&quot;+i];
if (clip._xscale>min) {
clip._xscale--;
clip._yscale--;
clip._alpha--;
}
}
}
 
Am I missing something here?

I have one movie clip naned text, the script on it on one frame. And it is not working. The script has no end...

thanks
yannick
 
The script should be attached to a separate movieClip - these are usually referred to as &quot;control&quot; or &quot;dummy&quot; clips because they're just there to hold code which affects the rest of the movie - in other words have two clips: your &quot;text&quot; clip and another which has this script attached.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top