JStevensJr
05-11-2009, 04:27 PM
I am building my very first Flash web site and I am encountering problems with the buttons and actionscript.
I am tremendously appreciative of any and all advice.
The web site contains 5 pages: home, about, menu, locations and contact
When the "home" page loads, all of the buttons work just fine. But when any of the other pages load, only the "home" button works. For example, I am unable to jump directly from the "about" page to the "menu" page because those buttons only work properly when the "home" page is loaded.
link to screen grab of Flash timeline (http://www.broadcastresource.com/flash_1.jpg)
Below is the actionscript at frame 0 in the "Actions/Labels" layer:
stop();
about_btn.addEventListener(MouseEvent.CLICK, gotoABOUT);
function gotoABOUT(event:MouseEvent):void
{
gotoAndPlay(10);
}
menu_btn.addEventListener(MouseEvent.CLICK, gotoMENU);
function gotoMENU(event:MouseEvent):void
{
gotoAndPlay(20);
}
locations_btn.addEventListener(MouseEvent.CLICK, gotoLOCATIONS);
function gotoLOCATIONS(event:MouseEvent):void
{
gotoAndPlay(30);
}
contact_btn.addEventListener(MouseEvent.CLICK, gotoCONTACT);
function gotoCONTACT(event:MouseEvent):void
{
gotoAndPlay(40);
}
home_btn.addEventListener(MouseEvent.CLICK, gotoHOME);
function gotoHOME(event:MouseEvent):void
{
gotoAndPlay(1);
}
Frames 9, 19, 29, 39 and 50 contain:
stop();
Again, thank you for any and all advice!
JS
I am tremendously appreciative of any and all advice.
The web site contains 5 pages: home, about, menu, locations and contact
When the "home" page loads, all of the buttons work just fine. But when any of the other pages load, only the "home" button works. For example, I am unable to jump directly from the "about" page to the "menu" page because those buttons only work properly when the "home" page is loaded.
link to screen grab of Flash timeline (http://www.broadcastresource.com/flash_1.jpg)
Below is the actionscript at frame 0 in the "Actions/Labels" layer:
stop();
about_btn.addEventListener(MouseEvent.CLICK, gotoABOUT);
function gotoABOUT(event:MouseEvent):void
{
gotoAndPlay(10);
}
menu_btn.addEventListener(MouseEvent.CLICK, gotoMENU);
function gotoMENU(event:MouseEvent):void
{
gotoAndPlay(20);
}
locations_btn.addEventListener(MouseEvent.CLICK, gotoLOCATIONS);
function gotoLOCATIONS(event:MouseEvent):void
{
gotoAndPlay(30);
}
contact_btn.addEventListener(MouseEvent.CLICK, gotoCONTACT);
function gotoCONTACT(event:MouseEvent):void
{
gotoAndPlay(40);
}
home_btn.addEventListener(MouseEvent.CLICK, gotoHOME);
function gotoHOME(event:MouseEvent):void
{
gotoAndPlay(1);
}
Frames 9, 19, 29, 39 and 50 contain:
stop();
Again, thank you for any and all advice!
JS