0

I have a function (gofromTheFuture) that controls tweening objects that is then linked to various buttons, however I also want it to be called from this function below, but flash gives me this error: Incorrect number of arguments. Expected 1.

function exitHandler(event:Event):void
    {
        event.preventDefault();
        gofromTheFuture();
    }

function gofromTheFuture(evt:Event):void{
        myTimeline2.insertMultiple( TweenMax.allTo([TheFutureArtwork, pausebutton, playbutton, Verse, Chorus, Verseto1, Verseto2, Chorusto1, Chorusto2, rewind, fastforward, progressline, progressbar, TheFutureComments],
        0.25, {x:"450", autoAlpha:0, onComplete:exitAnimation}) );
        }

        function exitAnimation():void {
        trace("Return to main menu.");
        gotoAndStop(1, "Menu");

        }

How do I call this gofromTheFuture from within this function? Thanks

3
  • You're missing arguments for gofromTheFuture(), can you post that function? Either that or you're trying to call exitHandler() without an Event. Commented Jan 28, 2014 at 22:21
  • Are you trying to call exitHandler directly? Commented Jan 28, 2014 at 22:24
  • I have another button that needs the preventDefault so I made this new function called exitHandler that executes when the button is pressed. Commented Jan 28, 2014 at 22:25

1 Answer 1

1

Try change gofromTheFuture() to:

function gofromTheFuture(evt:Event = null):void
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.