# Help with linking buttons on Flash CS5.5



## CrazyComputerMan (Apr 16, 2007)

Tried everything that i think it should work but it isnt.

Tried added timeline with this code

myBtn.onRelease = function() { 
getURL(http://www.yda.org.uk/events/events.html);
};

Still dont work. They will be on that path when i upload new website.Why?


----------



## CrazyComputerMan (Apr 16, 2007)

The button name is events_btn

Added AS to the layers. Probably why itsnt working.


----------



## ccube (Jun 15, 2010)

The AS3 code format that CS5 uses is very different to the AS2 code you have there. Try this:


```
[SIZE="4"]
events_btn.AddEventListener(MouseEvent.CLICK, goToURL);
function goToURL(event:Event):void{
navigateToURL(new URLRequest("http://www.yda.org.uk/events/events.html"), "_blank");
}
[/SIZE]
```
All of the AS for a project should go on a layer dedicated to AS, makes it easier to find (not searching through frames)


----------



## CrazyComputerMan (Apr 16, 2007)

Can i replace "_blank" with "_self" as i want to open it in same window.

Thanks


----------



## CrazyComputerMan (Apr 16, 2007)

Tried code above but error appear as

Might help as tried to use Code Snippets.but have to use ActionScript 3.0 and Adobe only given me option to use AS 1.0 & 2.0.


----------



## CrazyComputerMan (Apr 16, 2007)




----------

