homepage Welcome to WebmasterWorld Guest from 54.166.173.147
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

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




msg:3929871
 8:16 pm on Jun 9, 2009 (gmt 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.

 

tr8er8




msg:3944559
 4:58 am on Jul 2, 2009 (gmt 0)

do you have a movie clip called replay with instance name replay?

kidd6441




msg:3944768
 11:57 am on Jul 2, 2009 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved