Forum Moderators: open
I wanted to insert a simple replay button at the end of a flash animation. The button name and instance name is "replay", and this is the AS3 code I'm using:
stop();
replay.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
gotoAndPlay(1);
}
When I try to test it I get this error:
1120: Access of undefined property replay.
What am I doing wrong? Thanks.