A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: How can I time a slideshow?

  1. #1
    almost there
    Join Date
    Jun 2005
    Posts
    11

    timer problem

    I donít have very much experience with Flash or actionscript. I usually follow tutorials. Iím trying to create a slideshow using actionscript that will play continuous while showing each picture for ten sec. I also want to have the ability to click a button and have it go to that selected picture. I used this tutorial http://www.actionscripts.org/tutoria...um/index.shtml that has shown me how to select a picture by clicking a button, but I canít figure out how to do both and keep the effect.
    Last edited by kurios77; 06-09-2005 at 09:31 AM.

  2. #2
    Space Monkey daarboven's Avatar
    Join Date
    Sep 2001
    Location
    in the basement boiling soap...
    Posts
    217
    use setInterval to let the slideshow run automatically, and use clear interval on your buttons. don't forget to use setInterval after clearing it again so the auto-function is triggered again.
    :::i am jacks complete lack of surprise:::

  3. #3
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    I have used set and clearInterval many times in various movies, and have never had it behave right, except in the simplest movies, and then it messes up if I load that movie into another. I gave up. The simplest timer is one with enough frames in the timeline to take up the amount of time you want, and code in the last frame to make it do something. Just letting it loop triggers the last frame code every time, and you can turn it on and off at will. And, best of all, it ALWAYS works as expected.

  4. #4
    almost there
    Join Date
    Jun 2005
    Posts
    11
    would I still be able to get the same effect that I get now?

  5. #5
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    What line of code are you using on a button to trigger your effect now? Essentially, any line of code after the on(release) line in button code can be used as frame code. Like in the last frame of that timer mc.

  6. #6
    almost there
    Join Date
    Jun 2005
    Posts
    11
    for (i=1; i<=pos.length; i++) {
    _level0["the"+i+"_btn"].n = i;
    _level0.info_txt.text = _level0.theInfo[0];
    _level0["the"+i+"_btn"].onRelease = function() {
    _level0.theTgt = _level0.pos[this.n-1]*-1;
    _level0.info_txt.text = _level0.theInfo[this.n-1];
    _level0.mask_mc.gotoAndStop(Math.round(Math.random ()*_level0.numOfFrames+1));
    };

  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Try it. Put that in the last frame of the timer movie clip. Should work. Change it to remove the onrelease line

    for (i=1; i<=pos.length; i++) {
    _level0["the"+i+"_btn"].n = i;
    _level0.info_txt.text = _level0.theInfo[0];
    _level0.theTgt = _level0.pos[this.n-1]*-1;
    _level0.info_txt.text = _level0.theInfo[this.n-1];
    _level0.mask_mc.gotoAndStop(Math.round(Math.random ()*_level0.numOfFrames+1));

  8. #8
    almost there
    Join Date
    Jun 2005
    Posts
    11
    Do I need to make a separate movie clip for my rotation

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    You lost me. What rotation? This is just about timing. If you had it working from a button before, it ought to work from frame code.

  10. #10
    almost there
    Join Date
    Jun 2005
    Posts
    11
    no rotation. I just want it to play automaticlly, and stop when someone clicks on a button.
    Last edited by kurios77; 06-09-2005 at 03:55 PM.

  11. #11
    almost there
    Join Date
    Jun 2005
    Posts
    11
    I got it to work thank you for all your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center