Welcome to WebmasterWorld Guest from 54.146.221.231

Forum Moderators: open

Message Too Old, No Replies

Actionscript 3 error "1120: Access of undefined property replay"

     
8:16 pm on Jun 9, 2009 (gmt 0)

New User

5+ Year Member

joined:May 22, 2009
posts: 8
votes: 0


VERY new to Flash.

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.

4:58 am on July 2, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 6, 2008
posts:94
votes: 0


do you have a movie clip called replay with instance name replay?
11:57 am on July 2, 2009 (gmt 0)

New User

5+ Year Member

joined:May 22, 2009
posts:8
votes: 0


tr8er8, thanks but I figured out the problem-- I needed to have the button exist throughout the whole timeline of the animation, that was all.