Hello. I am using Adobe Flash CS6. I am having trouble making 2 separate links for 2 buttons. I have been unsuccessful. I made 2 different buttons and thought i made 2 separate links. But, When both buttons are clicked, they link to the same page. I want them to go to separate pages.... Any suggestions? Here is a link to the file... Maybe someone could pin point the problem?
First of all, Thank you kindly for your reply. I have made 2 separate buttons with different instance names. I am able to apply the Geturl code to the first button, but the second button states as follows: To add code to this object, please select an instance of the object either in the main timeline, or a moviclip timeline.
I also do not have the stock snippet for geturl, so i had to create a custom. Kind of confused.
I know this is probably terrible but...
addEventListener(MouseEvent.CLICK,
fl_ClickToGoToWebPage_4);
function fl_ClickToGoToWebPage_4(event:MouseEvent):void
{
navigateToURL(new
URLRequest("http://www.k1llsquad.com"), "_blank");
}
addEventListener(MouseEvent.CLICK,
fl_ClickToGoToWebPage_5);
function fl_ClickToGoToWebPage_5(event:MouseEvent):void
{
navigateToURL(new
URLRequest("http://www.k1llsquadmoh.enjin.com"), "_blank");
}
There is nothing terrible about the code, it is just missing a couple things.
The problem with what you have now is that you are essentially adding two event listeners to the stage/main timeline, so when you click anything you trigger both functions, but only one of them can ultimately win (probably the last executed).
Select the button for the first set of code that you show and in the Properties panel, assign it an instance name where it says "<Instance Name>"... let's say you name it "page4Btn" Then change your first line of code to be...
page4Btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_4);
Then repeat the process for the other button, using a different instance name for the button.
North America
Europe, Middle East and Africa
Asia Pacific