0
votes

Why does this not work (doesn't go to frame 15)

navLeft.addEventListener(MouseEvent.CLICK, goLeft2);
function goLeft2(e:MouseEvent):void
{
    TweenLite.to(page1ani2, 1, {x:880, y:215, onComplete: goLeft22});
}
function goLeft22(e:MouseEvent):void
{
    gotoAndStop(15);
}

yet this does!

navLeft.addEventListener(MouseEvent.CLICK, goLeft22);
function goLeft22(e:MouseEvent):void
{
    gotoAndStop(15);
}

It doesn't like to do a tween before going to the gotoAndstop() function, why is this?

any help appreciated.

Ian

1

1 Answers

0
votes

This does not work because you have goLeft22() with an expected argument of type MouseEvent. Try changing it to:

function goLeft22(e:MouseEvent=null):void
{
    gotoAndStop(15);
}

This makes the argument optional.