# Problems linking buttons to timeline

**URL:** <https://forum.kirupa.com/t/problems-linking-buttons-to-timeline/264999>\
**Category:** Uncategorized\
**Created:** [July 2, 2008, 8:51pm UTC](https://forum.kirupa.com/t/problems-linking-buttons-to-timeline/264999 "2008-07-02T20:51:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![limeman](https://avatars.discourse-cdn.com/v4/letter/l/b487fb/32.png) [@limeman](https://forum.kirupa.com/u/limeman)\
**Post date:** [July 2, 2008, 8:51pm UTC](https://forum.kirupa.com/t/problems-linking-buttons-to-timeline/264999/1 "2008-07-02T20:51:19Z")

</div>

Hi,

I’m new to Flash so i’m trying to get my head round AS3. I’m building a new website but have encountered some errors already!!!

I’m just trying to create basic navigation for my site. 3 buttons which link to flags in the timeline:

[LIST]  
[\*]Home  
[/LIST]

[LIST]  
[\*]Resources  
[/LIST]

[LIST]  
[\*]Production  
[/LIST]  
But when I publish this error appears:

ArgumentError: Error #1063: Argument count mismatch on mysite\_fla::MainTimeline/resClick(). Expected 2, got 1.

here’s the code:

stop()  
import flash.events.MouseEvent

//button timeline

home\_Btn.addEventListener(MouseEvent.CLICK,homeClick);  
res\_Btn.addEventListener(MouseEvent.CLICK,resClick);  
pro\_Btn.addEventListener(MouseEvent.CLICK,proClick);

function homeClick(Event,MouseEvent):void  
{  
gotoAndStop(“Home”);  
}  
function resClick(Event,MouseEvent):void  
{  
gotoAndStop(“Resources”);  
}  
function proClick(Event,MouseEvent):void  
{  
gotoAndStop(“Production”);  
}

Appreciate any help offered,

Thanks,  
limeman

---

<div class="post-metadata">

**Author:** ![limeman](https://avatars.discourse-cdn.com/v4/letter/l/b487fb/32.png) [@limeman](https://forum.kirupa.com/u/limeman)\
**Post date:** [July 3, 2008, 1:02pm UTC](https://forum.kirupa.com/t/problems-linking-buttons-to-timeline/264999/2 "2008-07-03T13:02:46Z")

</div>

Thanks Mattrock, that helped. I have no errors now.

However, the nav buttons only work once. For example I click on the “resources” button which displays the “resources” content which is great, but when I click on any of the other buttons it stays in the “resources” content.

Here’s the updated code:

\*\*stop()

home\_Btn.addEventListener(MouseEvent.CLICK, goHome);  
res\_Btn.addEventListener(MouseEvent.CLICK, goResource);  
pro\_Btn.addEventListener(MouseEvent.CLICK, goProd);

function goHome (e:MouseEvent):void  
{  
gotoAndStop(“Home”);  
}  
function goResource (e:MouseEvent):void  
{  
gotoAndStop(“Resources”);  
}  
function goProd (e:MouseEvent):void  
{  
gotoAndStop(“Production”);  
}\*\*

if anyone one could help I would be very grateful.

Thanks,  
L
