PDA

View Full Version : easing menu > onClipEvent trouble..


astroscout7
12-27-2005, 04:05 AM
Thanks to this tutorial (http://actionscripts.org/tutorials/intermediate/Easing_Menu_System/index.shtml) I was able to come up with a pretty cool sub menu system, but I wanted to take it a step further.. I was trying to add a menu marker (blue line with arrow in sample) that slides from side to side to mark which sub menu the user was viewing. The problem is that I can either get the sub nav to scroll OR I can get the marker to work but not both at the same time. How can I combine the code so that they both work?

You can see a sample here (http://www.circleatseven.com/ALEX/actionscripts_org/menu.html) and download source files here (http://www.circleatseven.com/ALEX/actionscripts_org/menu.zip).

Thanks for your help!

goliatone
12-27-2005, 06:28 PM
aig fella...here it is...smooth n' sweet...ok. i did it really fast, sorry i didnt have time to explain what had changed...but you can take a look and figure it out.

but basically:
1-named both moving elements (slider and marker)
2-put all the code in just one mc instance (made one onClipEvent with the two u had there...)
3-renamed some vars( marker_endX instead of endX, which you used in the two scripts...)
4-actually, you only want to move each object in one coordinate axe: slider in y, and marker in x.

and...well, if you still have some hints, let me know. By the way...:rolleyes: .. i like the menu, so wont be surprised if i use the idea.


by the way, i went to Woodstock H.S (Woodstock, GA)...;) love the south.

astroscout7
12-27-2005, 11:14 PM
Thanks dude - that is perfect!

I had another thought for improvement, but I realize this one may be way too complex so don't sweat it... Ok here it goes:

What if after a few seconds of inactivity [ie - user does not click anything or is not rolled over one of the main or sub buttons] the menu goes back to hiding? Is that possible?

Dirty Souf! (I'm actually from the north.)

Headshotz
12-28-2005, 01:01 AM
This is a start


wait = 5;
starTimer = true;
createEmptyMovieClip("codeholder", getNextHighestDepth());
codeholder.onEnterFrame = function() {
if (starTimer) {
if (startTime == undefined) {
startTime = getTimer()/1000;
}
curTime = getTimer()/1000;
if ((curTime-startTime)>=wait) {
starTimer = false;
delete startTime;
// Place the code for hiding menu
// In here =)
} else {
_root.timeRemaining = wait-(curTime-startTime);
}
}
};


That was really quick but it is possible to modify it so it acheives what you are after.

goliatone
12-28-2005, 02:35 AM
This is a start
.
.
.
That was really quick but it is possible to modify it so it acheives what you are after.


okis, it is a place to start...i will give it a look tomorrow...my brain is off rigth now.

thanks Headshotz!

astroscout7
12-28-2005, 02:43 AM
You guys rock! Thanks for the help!

Headshotz
12-28-2005, 06:21 AM
:)

You just need to loop it and write the actual code for hiding the menu, basically that is just a timer.