Unit 02 - Design and Navigation

Importing Photoshop into Flash

 

Creating Sections in Flash

Adding Menu Buttons in Flash -

Programing Menus Button Part 01

stop();
//add an EventListener to a button instance
about.addEventListener(MouseEvent.CLICK,gotoPage);

//create gotoPage function
function gotoPage(evtObj:MouseEvent) {
trace("about button was clicked")
}

Programing Menus Button Part 02

stop();

//add an EventListener to a button instance
home.addEventListener(MouseEvent.CLICK,gotoHome);
about.addEventListener(MouseEvent.CLICK,gotoAbout);
pictures.addEventListener(MouseEvent.CLICK,gotoPictures);
contact.addEventListener(MouseEvent.CLICK,gotoContact);

//create gotoPage function
function gotoHome(evtObj:MouseEvent) {
trace("home button was clicked");
gotoAndStop("home");
}

function gotoAbout(evtObj:MouseEvent) {
trace("about button was clicked");
gotoAndStop("about");
}

function gotoPictures(evtObj:MouseEvent) {
trace("pictures button was clicked");
gotoAndStop("pictures");
}

function gotoContact(evtObj:MouseEvent) {
trace("contact button was clicked");
gotoAndStop("contact");
}

Programing Menus Button Part 03

stop();

//add an EventListener to a button instance
home.addEventListener(MouseEvent.CLICK,gotoPage);
about.addEventListener(MouseEvent.CLICK,gotoPage);
pictures.addEventListener(MouseEvent.CLICK,gotoPage);
contact.addEventListener(MouseEvent.CLICK,gotoPage);

//create gotoPage functions
function gotoPage(evtObj:MouseEvent) {
trace("the " + evtObj.target.name + " button was clicked")
gotoAndStop(evtObj.target.name);
}

 

Check this site out for more information

http://www.republicofcode.com/tutorials/flash/as3events/

 

Homework

Finalize your design and import it into Flash. Create section so that there are multiple pages on the timeline. Create and program buttons that navigate to the individual pages.