stop();
var thisDepth:Number;
//handle events for buttons… about, home, portfolio are labels names in timeline
stage1_btn.addEventListener(MouseEvent.CLICK, clickSection);
stage2_btn.addEventListener(MouseEvent.CLICK, clickSection);
stage3_btn.addEventListener(MouseEvent.CLICK, clickSection);
stage4_btn.addEventListener(MouseEvent.CLICK, clickSection);
stage5_btn.addEventListener(MouseEvent.CLICK, clickSection);
stage1_btn.addEventListener(MouseEvent.MOUSE_OVER, rollSection);
stage2_btn.addEventListener(MouseEvent.MOUSE_OVER, rollSection);
stage3_btn.addEventListener(MouseEvent.MOUSE_OVER, rollSection);
stage4_btn.addEventListener(MouseEvent.MOUSE_OVER, rollSection);
stage5_btn.addEventListener(MouseEvent.MOUSE_OVER, rollSection);
function clickSection(evtObj:MouseEvent) {
trace("The "+evtObj.target.name+" button was clicked!");
//go to the section clicked on...
gotoAndStop(evtObj.target.name);
}
function rollSection(evtObject:MouseEvent) {
trace("The "+evtObject.target.name+" button was rolled!");
//bring to the highest depth
this.setChildIndex(evtObject.target.name,this.numChildren-1);
}
Do more with
Premium Content
You need an Expert Office subscription to comment.Start Free Trial