flash - Newbie question: Stop() hide EnventListener -


This is a very simple question, but I did not find anything on the internet (or I do not enter good words on it Google).

I try to apply a gallery of images with two buttons on each side of the image to go to the next or previous image. is very easy!

This is my code:

  leftButton.addEventListener (mouse Event.click, button lefthandler); RightButton.addEventListener (MouseEvent.CLICK, ButtonRightHandler); Function Button Left Handler (Event: Mouse Event): Zero {trace ("mouse button left click"); PicIndex--; UiLoader.source = picIndex + ".jpg"; GotoAndPlay (23); } Function ButtonRightHandler (Event: MouseEvent): Zero {trace ("mouse button right click"); PicIndex ++; UiLoader.source = picIndex + ".jpg"; GotoAndPlay (23); } Stop (); Trace ("sequence off");   

UI loader and PCIDX are defined in the first frame.

On my output, I

  Done   

When I click on a button I did not find the trace message "mouse button left ..." my sequence is blocked.

Why ?!

Thanks

Your button must be placed alongside the example names that you use Are assigned in the properties panel ( leftButton and rightbutton ). They should also be available (on stage) on the frame running on this frame.

Comments