Hi,
I'm making my web page and I want to add a slideshow That shows you the promotions I have.
In this slideshow I put a TIMER so it pass 5 secs when to change it to the next image, so Also I put buttons When you click button 1 or 2 or 3 it shows you image 1 or 2 or 3.
The problem
Everything runs OK But when i click on Any button (1 or 2 or 3) just When It's about to change to the next image (frame) it starts to go crazy, it goes from the first frame to the third and again and again ( If I click Any Other moment it runs perfect).
Here is my code:
stop ();
//--- ---// Buttons 1 2 3
boton1.addEventListener (MouseEvent. CLICK, play1)
play1 function (event: MouseEvent): void {
gotoAndStop ("pban1");
}
boton2.addEventListener (MouseEvent.CLICK, play2)
play2 function (event: MouseEvent): void {
gotoAndStop ("pban2");
}
boton3.addEventListener (MouseEvent. CLICK, play3)
play3 function (event: MouseEvent): void {
gotoAndStop ("pban3");
}
//--- ---// Timer
var Nextimage: Timer = new Timer (5000);
nextImagen.addEventListener (TimerEvent.TIMER, playNext)
nextImagen.start ();
playNext function (event: TimerEvent): void
{
nextFrame ();
}
- stop ();
- //--- ---// Buttons 1 2 3
- boton1.addEventListener (MouseEvent. CLICK, play1)
- play1 function (event: MouseEvent): void {
- gotoAndStop ("pban1");
- }
- boton2.addEventListener (MouseEvent.CLICK, play2)
- play2 function (event: MouseEvent): void {
- gotoAndStop ("pban2");
- }
- boton3.addEventListener (MouseEvent. CLICK, play3)
- play3 function (event: MouseEvent): void {
- gotoAndStop ("pban3");
- }
- //--- ---// Timer
- var Nextimage: Timer = new Timer (5000);
- nextImagen.addEventListener (TimerEvent.TIMER, playNext)
- nextImagen.start ();
- playNext function (event: TimerEvent): void
- {
- nextFrame ();
- }
Also I create a blank frame at the Fourth Images layer and I add this code:
nextImagen.stop ();
Nextimage. reset ();
gotoAndStop (1)
- nextImagen.stop ();
- Nextimage. reset ();
- gotoAndStop (1)
NOW...
What can I do to Prevent this from happening?
I Thought I Could Probably add Something to make the TIMER stops When you click the 1, 2, 3 buttons...But I do not know how (I'm just suggesting i actually do not know if it can be done or if There is another way).