13 Replies - 8396 Views - Last Post: 17 November 2009 - 04:19 AM

#1 devdoubt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-November 09

Flash auto slide show

Post icon  Posted 04 November 2009 - 10:48 AM

Hello sir

Im a beginner learning flash, actually im developing a flash slide show with over 40 slides, i am facing difficulty in the following context

There is a button named auto play when clicked should display the slides automatically one after another without user interaction, so how is this done using action script or is there any easy procedure to do this?Please help!!!!!!!!!
Is This A Good Question/Topic? 0
  • +

Replies To: Flash auto slide show

#2 thehat   User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Flash auto slide show

Posted 04 November 2009 - 02:08 PM

Do you already have code to move between the slides? You'll need that, plus some sort of timer. In AS2 you would use setInterval:
var myInterval:Number = setInterval(this, "function", 1000);

Where this refers to the scope of the interval (usually this), "function" is the name of the function you want to call as a string and 1000 is the time between executions in milliseconds.

In AS3 it's like this:
import flash.utils.Timer;
import flash.events.TimerEvent;

var myTimer:Timer = new Timer(1000,0);
myTimer.addEventListener(TimerEvent.Timer,timerHandler);
myTimer.start();

function timerHandler(evt:TimerEvent):void {
	 //do something
}


Here the timer is initialized with vales of time and loops. Using 0 for the loops will cause infinite looping. The listener calls a function called timerHandler after every loop.
Was This Post Helpful? 0
  • +
  • -

#3 devdoubt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-November 09

Re: Flash auto slide show

Posted 05 November 2009 - 02:24 AM

Thanks for ur reply sir, actually the thing is im a beginner learning flash, so i dont know how to write code to move between slides, so i request for ur help in this.....

Thank u
Was This Post Helpful? 0
  • +
  • -

#4 thehat   User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Flash auto slide show

Posted 05 November 2009 - 03:09 AM

What format are these slides? If they're just images then there a lot of tutorials online to produce image slideshows in flash. If they are movieclips containing animation then the job is a little trickier, but the essential things you need to thing about are:
  • Generating a list of your content, be it hard coded into Flash or loaded from an external source like an XML file.
  • Attaching each slide to the stage. Whether you attach just one or more than that will depend on the transition you want between slides.
  • The manner of transition between the slides. An easy one to go for if you're starting out is just to fade one away and fade in the next.

Here at Dream in Code we try not to just post entire code solutions for people, but instead we try to guide them through the process of creating their project. With this in mind, if you tell me some more details I will try to show you what code elements you're going to need and how to make them work.

This post has been edited by thehat: 05 November 2009 - 03:10 AM

Was This Post Helpful? 0
  • +
  • -

#5 devdoubt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-November 09

Re: Flash auto slide show

Posted 05 November 2009 - 07:41 AM

Hello sir,

Actually im preparing slide show presentation using flash presentation tool, with over 40 slides which consists of jpeg image one on each slide with a slight transition effect available in flash.Each slide has got prev, next buttons to navigate from one slide to another.

Now i am placing a button AUTOPLAY on slide1 such that when user clicks on the button, the slides should display automatically one after another till the last slide. So i need to write code for this requirement. And im not getting idea to do this? Kindly help.......


Thank u
Was This Post Helpful? 0
  • +
  • -

#6 thehat   User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Flash auto slide show

Posted 05 November 2009 - 08:34 AM

Okay cool, so you must have some code somewhere that handles the next and previous clicks. If you can post that I will show you how to add a Timer to call the next button's code repeatedly. If it's easier you can zip up your flash file and attach it here.
Was This Post Helpful? 0
  • +
  • -

#7 devdoubt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-November 09

Re: Flash auto slide show

Posted 07 November 2009 - 10:09 AM

Actually i cant put the file as it is a company file, but the thing is i have not written any script on my own. I have just used actions that are built in available in flash like "Go to next slide" when NEXT button is clicked, similarly to previous button, the action is go to previous slide and so on.
Was This Post Helpful? 0
  • +
  • -

#8 thehat   User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Flash auto slide show

Posted 08 November 2009 - 04:21 PM

Sorry, I didn't realise that you were talking about the slide presentation mode!! The following moves to the next slide every second (1000 milliseconds), or back to the first slide if you're at the last one:
var intID:Number = setInterval(doSlide,1000);

function doSlide() {
	if(_root.presentation.currentSlide.nextSlide != null) {
		_root.presentation.currentSlide.gotoNextSlide();
	} else {
		_root.presentation.gotoSlide(_root.presentation.firstSlide);
	}
}



To stop it again you use clearInterval(_root.presentation.intId);

Obviously these will need to be added to buttons, or maybe you would have it on one button that you can toggle.
Was This Post Helpful? 0
  • +
  • -

#9 devdoubt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-November 09

Re: Flash auto slide show

Posted 09 November 2009 - 03:47 AM

Thank u sir, this is wat is was trying to convey, it is working but to stop autoplay where should i insert code.

Like the idea is when the slide show is auto, and when user interrupts by pressing some NEXT button or something, the autoplay should stop and come back to normal mode. Wat is to be done?
Was This Post Helpful? 0
  • +
  • -

#10 thehat   User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Flash auto slide show

Posted 10 November 2009 - 02:18 AM

You already have actions for your next and previous buttons, so you just need to include in that code the line that clears the interval: clearInterval(_root.presentation.intId);
Was This Post Helpful? 0
  • +
  • -

#11 devdoubt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-November 09

Re: Flash auto slide show

Posted 13 November 2009 - 01:08 AM

Thank you sir :)

Its working......
Was This Post Helpful? 0
  • +
  • -

#12 devdoubt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-November 09

Re: Flash auto slide show

Posted 14 November 2009 - 11:48 AM

Actually the auto button is workng like this:

When auto is pressed on 1st slide, its displaying all slides auto till the last slide and stops.Now the problem is i want the auto slide show to be stopped when user presses on some button say "NEXT" or something in some slide in the middle of auto show.

So how do i stop this. DO i hav to add clearinterval code in all of the buttons in all of the 20 slides ...............
Was This Post Helpful? 0
  • +
  • -

#13 thehat   User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Flash auto slide show

Posted 16 November 2009 - 03:27 AM

You will do if you've put separate next buttons in every slide, yes. Something else you can do is put your control buttons on the presentation slide. This will make them visible on all of the presentation slide's children too.
Was This Post Helpful? 0
  • +
  • -

#14 devdoubt   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 04-November 09

Re: Flash auto slide show

Posted 17 November 2009 - 04:19 AM

Sorry for dragging this topic long. Actually im not getting clear idea of doin this..

Wat i wanted to do is when auto is clicked on 1st slide, it displays slides one after another with a time interval but when user clicks anywhere on the slide between the auto show, i want to stop the auto play and come back to normal mode. So should i write a mouse event for doing this and how is this to be done and where should i insert this code?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1