tag:blogger.com,1999:blog-6057799.post6204871465036173721..comments2023-03-26T18:47:47.424-05:00Comments on --Mike--: Slide shows and duplicate event listeners in Adobe Flash ActionScript 3Mike Warothttp://www.blogger.com/profile/12975818268596648269noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-6057799.post-91072910209026778602008-08-21T03:41:00.000-05:002008-08-21T03:41:00.000-05:00Hey, I don't know who you are but your post totall...Hey, I don't know who you are but your post totally saved my keister!<BR/><BR/>I've been working all day to figure out how deal with a duplicate addEventListener issue. I consider myself a pretty advanced AS3 coder...but this thing totally killed me.<BR/><BR/>Until I found your blog! Kudos! Good Karma coming your way!<BR/><BR/>g.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6057799.post-2663267910176292282008-08-12T13:24:00.000-05:002008-08-12T13:24:00.000-05:00You can avoid all of the issues mentioned above by...You can avoid all of the issues mentioned above by passing a qualified method as the listener, rather than the dynamic function you're using.<BR/><BR/>i.e.<BR/><B><BR/>Next_btn.addEventListener( MouseEvent.MOUSE_UP, goNextFrame );<BR/>Back_btn.addEventListener( MouseEvent.MOUSE_UP, goPrevFrame ); <BR/><BR/>function goNextFrame( e:MouseEvent ) :void<BR/>{<BR/> nextFrame();<BR/>}<BR/><BR/>function goPrevFrame( e:MouseEvent ) :void<BR/>{<BR/> prevFrame();<BR/>}</B><BR/><BR/>By doing that you avoid any chance of listener duplication and avoid having to use <I>hasEventListener</I>Anonymousnoreply@blogger.com