Dynamic Flash Navigation Menu?

I am trying to create a Dynamic flash Navigation Menu which will disable the button of the page you are on leaving the button in the "hit" state and then active it once you have called for a new page and deactivate the new button. I know this can be done with movie clips and some old school... show more I am trying to create a Dynamic flash Navigation Menu which will disable the button of the page you are on leaving the button in the "hit" state and then active it once you have called for a new page and deactivate the new button.

I know this can be done with movie clips and some old school gotoAndPlay/Stop slight of hand but I would like to do this in actionscript so its nice, clean, and scalable for other projects.

Please replay back with any help

//Edited Addition

I am calling this swf in from a php include function. When I tried the swf in its current state all buttons but the home page where deactivated and home which should have been turned off let a user roll over and become active.

stop();

//get page string

var pageURL:String=ExternalInterface.call('w...

//set up website pages

var homeURL:String=('http://www.text.html');
var servicesURL:String=('http://www.text.htm...
var portfolioURL:String=('http://www.www.tex...
var associatesURL:String=('http://www.www.te...
var contactusURL:String=('http://www.www.tex...

// show rollover state of pageURL

function pageLoad():void {

if(pageURL==homeURL) {

nav.nav_home.gotoAndPlay("hit");

}else if(pageURL==servicesURL){

nav.nav_service.gotoAndPlay("hit");

}else if(pageURL==portfolioURL){

nav.nav_portfolio.gotoAndPlay("hit");

}else if(pageURL==associatesURL){

nav.nav_associates.gotoAndPlay("hit");

}else if(pageURL==contactusURL){

nav.nav_contactus.gotoAndPlay("hit");

}else{
gotoAndStop(1);
}
}
pageLoad();




/* main nav */

nav.nav_home.buttonMode = true;
nav.nav_home.addEventListener(MouseEve... onButtonOver);
nav.nav_home.addEventListener(MouseEve... onButtonOut);
nav.nav_home.addEventListener(MouseEve... nav_homeClick);

nav.nav_service.buttonMode = true;
nav.nav_service.addEventListener(Mouse... onButtonOver);
nav.nav_service.addEventListener(Mouse... onButtonOut);
nav.nav_service.addEventListener(Mouse... nav_serviceClick);

nav.nav_portfolio.buttonMode = true;
nav.nav_portfolio.addEventListener(Mou... onButtonOver);
nav.nav_portfolio.addEventListener(Mou... onButtonOut);
nav.nav_portfolio.addEventListener(Mou... nav_portfolioClick);

nav.nav_associates.buttonMode = true;
nav.nav_associates.addEventListener(Mo... onButtonOver);
nav.nav_associates.addEventListener(Mo... onButtonOut);
nav.nav_associates.addEventListener(Mo... nav_associatesClick);

nav.nav_contactus.buttonMode = true;
nav.nav_contactus.addEventListener(Mou... onButtonOver);
nav.nav_contactus.addEventListener(Mou... onButtonOut);
nav.nav_contactus.addEventListener(Mou... nav_contactusClick);

function onButtonOver(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay("over");
}

function onButtonOut(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay("out");
}




/* main nav */

function nav_homeClick(e:MouseEvent):void
{
var nav_homeURL:URLRequest = new URLRequest ("http://www.text.html");
navigateToURL(nav_homeURL, "_parent");
}

function nav_serviceClick(e:MouseEvent):void
{
var nav_serviceURL:URLRequest = new URLRequest ("http://www.www.text.html");
navigateToURL(nav_serviceURL, "_parent");
}

function nav_portfolioClick(e:MouseEvent):void
{
var nav_portfolioURL:URLRequest = new URLRequest ("http://www.text.html");
navigateToURL(nav_portfolioURL, "_parent");
}

function nav_associatesClick(e:MouseEvent):void
{
var nav_associatesURL:URLRequest = new URLRequest ("http://www.text.html");
navigateToURL(nav_associatesURL, "_parent");
}

function nav_contactusClick(e:MouseEvent):void
{
var nav_contactusURL:URLRequest = new URLRequest ("http://www.text.html");
navigateToURL(nav_contactusURL, "_parent");
}
3 answers 3