Hi guys,
Building a website for myself and I know a bit of flash but not much. Mostly following tutorials and adapting for my own purposes. Anyway I am building a menu bar, which when you hover over certain items drops down a submenu. I can get the submenu to drop down ok but I cant figure out how to get it to link (jump) to a new frame/scene.
Can anyone point me in right direction?
I think problem is in function showSubMenu ?
Flash CS4, AS3
----- Code -----
// SETTINGS
// Make submenu buttons hidden
btn_Set.btn_Set1.visible = false;
btn_Set.btn_Set2.visible = false;
// Add event listeners for main button
btn_Set.addEventListener(MouseEvent.MOUSE_OVER,showMenu);
btn_Set.addEventListener(MouseEvent.MOUSE_OUT,showMenu);
// Main button action - disabled currently
//btn_Set.addEventListener(MouseEvent.CLICK,buttonClicked);
// Add event listeners for submenu buttons
for(var i=1;i<3;i++){
btn_Set["btn_Set"+i].addEventListener(MouseEvent.MOUSE_OVER,showSubMenu);
btn_Set["btn_Set"+i].addEventListener(MouseEvent.MOUSE_OUT,showSubMenu);
btn_Set["btn_Set"+i].addEventListener(MouseEvent.MOUSE_DOWN,showSubMenu);
}
// Actions for main button
function showMenu(e:MouseEvent){
if(e.type == "mouseOut"){
// Hide submenu when cursor moves off
e.currentTarget.btn_Set1.visible = false;
e.currentTarget.btn_Set2.visible = false;
}
if(e.type == "mouseOver"){
// Show submenu when cursor on
e.currentTarget.btn_Set1.visible = true;
e.currentTarget.btn_Set2.visible = true;
}
}
function showSubMenu(e:MouseEvent){
if(e.type == "mouseOut"){
}
if(e.type == "mouseOver"){
}
if(e.type == "mouseDown"){
if(e.currentTarget == "btn_Set.btn_Set1"){
// If submenu button 1 link
gotoAndStop("96");
}
if(e.currentTarget == "btn_Set.btn_Set2"){
// If submenu button 2 link
gotoAndStop("86")
}
}
}
// Main button action, disabled currently
//function buttonClicked(e:MouseEvent){
// gotoAndStop("106");
//}
Building a website for myself and I know a bit of flash but not much. Mostly following tutorials and adapting for my own purposes. Anyway I am building a menu bar, which when you hover over certain items drops down a submenu. I can get the submenu to drop down ok but I cant figure out how to get it to link (jump) to a new frame/scene.
Can anyone point me in right direction?
I think problem is in function showSubMenu ?
Flash CS4, AS3
----- Code -----
// SETTINGS
// Make submenu buttons hidden
btn_Set.btn_Set1.visible = false;
btn_Set.btn_Set2.visible = false;
// Add event listeners for main button
btn_Set.addEventListener(MouseEvent.MOUSE_OVER,showMenu);
btn_Set.addEventListener(MouseEvent.MOUSE_OUT,showMenu);
// Main button action - disabled currently
//btn_Set.addEventListener(MouseEvent.CLICK,buttonClicked);
// Add event listeners for submenu buttons
for(var i=1;i<3;i++){
btn_Set["btn_Set"+i].addEventListener(MouseEvent.MOUSE_OVER,showSubMenu);
btn_Set["btn_Set"+i].addEventListener(MouseEvent.MOUSE_OUT,showSubMenu);
btn_Set["btn_Set"+i].addEventListener(MouseEvent.MOUSE_DOWN,showSubMenu);
}
// Actions for main button
function showMenu(e:MouseEvent){
if(e.type == "mouseOut"){
// Hide submenu when cursor moves off
e.currentTarget.btn_Set1.visible = false;
e.currentTarget.btn_Set2.visible = false;
}
if(e.type == "mouseOver"){
// Show submenu when cursor on
e.currentTarget.btn_Set1.visible = true;
e.currentTarget.btn_Set2.visible = true;
}
}
function showSubMenu(e:MouseEvent){
if(e.type == "mouseOut"){
}
if(e.type == "mouseOver"){
}
if(e.type == "mouseDown"){
if(e.currentTarget == "btn_Set.btn_Set1"){
// If submenu button 1 link
gotoAndStop("96");
}
if(e.currentTarget == "btn_Set.btn_Set2"){
// If submenu button 2 link
gotoAndStop("86")
}
}
}
// Main button action, disabled currently
//function buttonClicked(e:MouseEvent){
// gotoAndStop("106");
//}