# Help with AS3 menu to point to url in frame/html

**URL:** <https://forum.kirupa.com/t/help-with-as3-menu-to-point-to-url-in-frame-html/324276>\
**Category:** flash\
**Created:** [August 11, 2011, 5:59pm UTC](https://forum.kirupa.com/t/help-with-as3-menu-to-point-to-url-in-frame-html/324276 "2011-08-11T17:59:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bipin\_Puri](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@Bipin\_Puri](https://forum.kirupa.com/u/Bipin_Puri)\
**Post date:** [August 11, 2011, 5:59pm UTC](https://forum.kirupa.com/t/help-with-as3-menu-to-point-to-url-in-frame-html/324276/1 "2011-08-11T17:59:18Z")

</div>

Hi, just know little basics. I have made a my website in flash but now plan to change it to html using frames and flash movies. The first problem I face is how to use my menu to point at the url in the desired frame.  
The current website i am changing is [www.sattvadezign.com](http://www.sattvadezign.com)

The code used for the menu is as follows:

stop();  
stage.frameRate = 30;  
//---- add the buttons to an array --------  
var buttonsArray:Array = [HomeMc,ProfileMc,PracticeMc,ProjectsMc,IdeasMc,ContactMc,LinksMc];

//----loop thru the buttonsArray-----  
//----set some properties and add events to buttons----  
function setButtons():void {  
for (var i:int=0; i\<buttonsArray.length; i++) {  
buttonsArray\*.id = i;  
buttonsArray\*.buttonMode = true;  
buttonsArray\*.mouseChildren = true;  
buttonsArray\*.mouseEnabled = true;  
buttonsArray\*.addEventListener(MouseEvent.ROLL\_OVER,Over);  
buttonsArray\*.addEventListener(MouseEvent.ROLL\_OUT,Out);  
buttonsArray\*.addEventListener(MouseEvent.CLICK,Click);  
}  
}  
//----fires when the mouse rolls over the button----  
function Over(event:MouseEvent):void {  
event.currentTarget.gotoAndPlay(“over”);  
}  
//----fires when the mouse rolls out the button----  
function Out(event:MouseEvent):void {  
event.currentTarget.gotoAndPlay(“out”);  
}  
//----fires when you click on the button  
function Click(event:MouseEvent):void{  
//----set the currentBtn variable equal with-----  
//----the id of the button that was clicked-----  
var currentBtn:int = event.currentTarget.id;  
//----call the setSelectedBtn function  
setSelectedBtn(currentBtn);  
}  
/_check to see witch button was clicked  
if the id passed to the setSelectedBtn function  
is identical with the id of the button clicked  
we put that buttons in the down state (selected)  
and remove all the events added to it_/  
function setSelectedBtn(id:int):void{  
for (var i:int=0; i\< buttonsArray.length; i++) {  
if (id == i) {  
buttonsArray\*.gotoAndPlay(“click”);  
buttonsArray\*.buttonMode = false;  
buttonsArray\*.mouseEnabled = false;  
buttonsArray\*.removeEventListener(MouseEvent.ROLL\_OVER,Over);  
buttonsArray\*.removeEventListener(MouseEvent.ROLL\_OUT,Out);  
buttonsArray\*.removeEventListener(MouseEvent.CLICK,Click);  
switch(id){  
case 0:  
MovieClip(parent).AllPages.gotoAndPlay(“Home”);  
break;  
case 1:  
MovieClip(parent).AllPages.gotoAndPlay(“Profile”);  
break;  
case 2:  
MovieClip(parent).AllPages.gotoAndPlay(“Practice”);  
break;  
case 3:  
MovieClip(parent).AllPages.gotoAndPlay(“Projects”);  
break;  
case 4:  
MovieClip(parent).AllPages.gotoAndPlay(“DesignIdeas”);  
break;  
case 5:  
MovieClip(parent).AllPages.gotoAndPlay(“Contact”);  
break;  
case 6:  
MovieClip(parent).AllPages.gotoAndPlay(“Links”);  
break;  
default:  
trace(“ups, something it’s wrong”);  
break;  
}  
} else {  
if(buttonsArray\*.currentLabel ==“click”){  
buttonsArray\*.gotoAndPlay(“out”);  
}  
buttonsArray\*.buttonMode = true;  
buttonsArray\*.mouseEnabled = true;  
buttonsArray\*.addEventListener(MouseEvent.ROLL\_OVER,Over);  
buttonsArray\*.addEventListener(MouseEvent.ROLL\_OUT,Out);  
buttonsArray\*.addEventListener(MouseEvent.CLICK,Click);  
}  
}  
}  
//----call the setButtons function----  
setButtons();  
setSelectedBtn(0);

///////////////////////////////////// END REFERENCE MAIN BUTTON ARRAY CODE ///////////////////////////////////////////

Thanks
