Slideshow Problem

  • CRF2
  • Born
  • Born
  • CRF2
  • Posts: 2

Post 3+ Months Ago

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:
Code: [ Select ]
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 ();
}
  1. stop ();
  2. //--- ---// Buttons 1 2 3
  3. boton1.addEventListener (MouseEvent. CLICK, play1)
  4. play1 function (event: MouseEvent): void {
  5. gotoAndStop ("pban1");
  6. }
  7. boton2.addEventListener (MouseEvent.CLICK, play2)
  8. play2 function (event: MouseEvent): void {
  9. gotoAndStop ("pban2");
  10. }
  11. boton3.addEventListener (MouseEvent. CLICK, play3)
  12. play3 function (event: MouseEvent): void {
  13. gotoAndStop ("pban3");
  14. }
  15. //--- ---// Timer
  16. var Nextimage: Timer = new Timer (5000);
  17. nextImagen.addEventListener (TimerEvent.TIMER, playNext)
  18. nextImagen.start ();
  19. playNext function (event: TimerEvent): void
  20. {
  21. nextFrame ();
  22. }


Also I create a blank frame at the Fourth Images layer and I add this code:
Code: [ Select ]
nextImagen.stop ();
Nextimage. reset ();
gotoAndStop (1)
  1. nextImagen.stop ();
  2. Nextimage. reset ();
  3. 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).
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 20 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.