# Button to call function

**URL:** <https://forum.kirupa.com/t/button-to-call-function/293088>\
**Category:** flash\
**Created:** [July 23, 2009, 3:41am UTC](https://forum.kirupa.com/t/button-to-call-function/293088 "2009-07-23T03:41:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![reblis](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@reblis](https://forum.kirupa.com/u/reblis)\
**Post date:** [July 23, 2009, 3:41am UTC](https://forum.kirupa.com/t/button-to-call-function/293088/1 "2009-07-23T03:41:14Z")

</div>

I ahve abutton function that I want to go to another function. it works but then it doesn’t use the onComplete I ahve for that function ( using tweener). Then the movie starts jumping around and the timing is off ont he elements.

I guess the button is calling the right function but when it fires and executes it then it start messing up.

This is the code I’m suing to call on another function in my code:

```auto

btnNext1.addEventListener(MouseEvent.CLICK, featureNext1);

function featureNext1(event:MouseEvent):void
{
    featureimg1();
}

```

here is the function that is executed, but then the onComplete part doesn’t work.

```auto

function featureimg1(){
        Tweener.addTween(features, { x:26.9 , alpha:1,time:.75, onComplete:timer1, transition:"easeInExpo"});
        btnNext1.y = 215;

```

This is for a slide show that I’m making that has next and previous image buttons.  
I would really appreciate some incite into this.

~reblis
