PDA

View Full Version : navigation


knop3se
06-17-2001, 05:30 PM
Hi!

Im trying to make a simple navigation bar, just a few buttons (Home, products etc...) the up state of all the buttons should have white text, but i want it so that when you press a button like "home" it should stay in the "down state" (black color text) until another button (like products) is pressed. What is the simplest way of doing this? Im a newbie so please explain as detalied as you can...

I had an idea of making one scene for each "button set", like the home button set (scene 1) would have the home button black in its "up state" and the other buttons white. The products button set (scene 2) would have the products button with black text and so on... and so if youŽre att scene 1 (home button set) and pressed the products button it would GET URL and goto scene 2, but im not sure this would work i havent tried yet, is there a better way?

Thanx!

/knop3se

Strok
06-17-2001, 08:59 PM
I made an example for you

http://www.actionscripts.org/help/stuff/nav.fla

knop3se
06-17-2001, 09:21 PM
Hey thanx ALOT man!

Im gonna study the .fla and try to figure out what you did. It looks like the buttons are movie clips and inside each movieclip is 2 frames of the up and down states of the buttons with stop actions on them?

IŽd like to have rollovers on those buttons too and maybe the over state could be a animation? (movieclip).

Im gonna try to figure this out but im pretty sure i will fail :-(


thanx again much appreciated :-)

/knop3se

knop3se
06-17-2001, 09:49 PM
Hey i think i understand now, the 3 buttons on the stage are movieclips with 2 frames in them where the first frame is a button ( with the rollover state and the 2nd frame is the down state of that button?

and then the action for the button is

on (release) {
_root.b1.gotoAndStop(2);
_root.b2.gotoAndStop(1);
_root.b3.gotoAndStop(1);
}

which basicly means that when first button is pressed goto frame 2 of that movieclip and stop, and also show button 2 and 3 in their upstates (frame1) ?

if this is incorrect could you please explain it to me in plain english, im from sweden so my english skills are a bit poor...


/knop3se

Strok
06-18-2001, 12:39 AM
yes
You got it right
b1, b2 and b3 are instance names for MCs (see a tutorial http://www.actionscripts.org/tutorials/beginner/paths/index.shtml )

and you can add any actions to the button:

on (release) {
_root.b1.gotoAndStop(2);
_root.b2.gotoAndStop(1);
_root.b3.gotoAndStop(1);
tellTarget (_root) {
gotoAndStop ("Scene 2", 1);
}
}

[Edited by Strok on 06-17-2001 at 07:50 PM]

knop3se
06-18-2001, 12:47 AM
cool!

thanx again man, iŽll try to make my own menu now :-)

/knop3se