Creating Navigation with Actionscript 3
mariahleigh33 Oct 21, 2009 7:44 PMSo I have created all new movie clips in my index.fla file by copying all of my files from another file and pasting them into the movie clip timeline. I have placed all of my new movie clips in different layers on the index timeline, and have created keyframes 10 frames apart. I have my actions layer with frame labels for each page every ten frames (i.e. tbLabel is at frame 1 in my actions layer and the movie clip is on a different layer at frame one, restaurantLabel is at frame 10 in my actions layer and the movie clip for that page is on a different layer at frame ten, all the way up to frame 120). I haven't put any actionscript in my movieclips except for stop(); at the end of each file. My current actionscript, placed in frame 1 for my first page when the viewer goes to the site is as follows:
thunderBayBtn.addEventListener(MouseEvent.CLICK, goIndex);
restaurantBtn.addEventListener(MouseEvent.CLICK, goRestaurant);
birchBtn.addEventListener(MouseEvent.CLICK, goBirch);
menuBtn.addEventListener(MouseEvent.CLICK, goMenu);
eventBtn.addEventListener(MouseEvent.CLICK, goEventLand);
davEventBtn.addEventListener(MouseEvent.CLICK, goDavEvent);
rockEventBtn.addEventListener(MouseEvent.CLICK, goRockEvent);
pewEventBtn.addEventListener(MouseEvent.CLICK, goPewEvent);
pewEventBtn.addEventListener(MouseEvent.CLICK, goPewEvent);
giftBtn.addEventListener(MouseEvent.CLICK, goGiftCert);
downloadBtn.addEventListener(MouseEvent.CLICK, goDownload);
contestBtn.addEventListener(MouseEvent.CLICK, goContestLand);
davContestBtn.addEventListener(MouseEvent.CLICK, goDavContest);
rockPewContestBtn.addEventListener(MouseEvent.CLICK, goRockPewContest);
function goIndex(event:MouseEvent):void
{
gotoAndPlay(1);
}
function goRestaurant(event:MouseEvent):void
{
gotoAndPlay(10);
}
function goBirch(event:MouseEvent):void
{
gotoAndPlay(20);
}
function goMenu(event:MouseEvent):void
{
gotoAndPlay(30);
}
function goEventLand(event:MouseEvent):void
{
gotoAndPlay(40);
}
function goDavEvent(event:MouseEvent):void
{
gotoAndPlay(50);
}
function goRockEvent(event:MouseEvent):void
{
gotoAndPlay(50);
}
function goPewEvent(event:MouseEvent):void
{
gotoAndPlay(50);
}
function goGiftCert(event:MouseEvent):void
{
gotoAndPlay(90);
}
function goDownload(event:MouseEvent):void
{
gotoAndPlay(100);
}
function goContestLand(event:MouseEvent):void
{
gotoAndPlay(110);
}
function goDavContest(event:MouseEvent):void
{
gotoAndPlay(120);
}
function goRockPewContest(event:MouseEvent):void
{
gotoAndPlay(120);
}
However, when I go to test the movie, I get "1120 access" errors even though the buttons are named in the properties pane, however, I cannot view that in the file that conatins all of my movie clips because they are movie clips.
Also, When I go to view the movie with all of my movie clips, all of them play one on top of the other, none of them stop, and the buttons do not work.
Is this the correct Actionscript?
I'm having a hard time figuring out what actionscript I need to use and where!


