Tuesday, 15 November 2011

Design of the site (Continued)

Once I had created the navigation I added content to each of the pages. I added the background to each frame of the site so in the frames panel I added 3 frames so the frames went up to 4 because that's how many pages I had. I did the same with the navigation so it span 4 frames and then created a new layer and called it contents and did the same. I then added text to all of the pages so I could see if the navigation worked on each page. To get the navigation to work I added an actions layer and made that span 4 frames and typed in the following code in actions panel in the first frame.

stop()
function onHomeClick(e:MouseEvent):void{
gotoAndStop("Home")
}
home_button.addEventListener(MouseEvent.CLICK, onHomeClick);

function onVenuesClick(e:MouseEvent):void{
gotoAndStop("Venues")
}
venues_button.addEventListener(MouseEvent.CLICK, onVenuesClick);

function onGamesClick(e:MouseEvent):void{
gotoAndStop("Games")
}
games_button.addEventListener(MouseEvent.CLICK, onGamesClick);

function onColourInClick(e:MouseEvent):void{
gotoAndStop("ColourIn")
}
colourin_button.addEventListener(MouseEvent.CLICK, onColourInClick);

Once this code had been added I tested the site to see if it worked and it did.

No comments:

Post a Comment