Flash 8 Slide Presentation help with slide navigation, please
A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: Flash 8 Slide Presentation help with slide navigation, please

  1. #1
    SnowKrash
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    32

    Flash 8 Slide Presentation help with slide navigation, please

    I think I finally found the right place to post this.

    I am simply trying to go from one slide to the next slide using a timer within a slide document in Flash 8.

    The behaviors I can attach are great for interaction like, go to next slide, and go to first slide, but how do I get any of those behaviors to trigger based on a timer, using action script, instead of navigating from slide to slide triggered by the action of the user?

    The client wants an auto slideshow on the front page of the site, and I am freaking out.

  2. #2
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    You can use setInterval to set the time, in milliseconds, you want to wait until the slide advances.

    Try this code on the timeline of your slide, it'll advance to the next slide after 5 seconds.

    code:

    function goNext(){
    gotoNextSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goNext, 5000);

    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  3. #3
    SnowKrash
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    32
    Thank you, Thank you, a thousand times, I thank you!!!!!!

  4. #4
    SnowKrash
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    32
    Okay, so that worked, until I got to the last slide... I wanted it to go to the first slide, so it seemed reasonable to do this:

    function goFirst(){
    gotoFirstSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goFirst, 4000);

    why does that not work? what am I doing wrong? Any help is appreciated, thanks

  5. #5
    SnowKrash
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    32
    Perhaps it would help if I showed you the site, and explained what I'm trying to achieve:

    http://www.krashonline.com/clients/ByQ/

    You'll notice, that when the photo on the right loads, a few seconds pass, then it fades out, with the next photo fading in... this is the exact behavior that occurs when you click on the photo as well.

    When the final slide is reached (the photo with the military men), the auto push with my code above does not push to the first slide. It just chokes. The only way at this point to advance to the first slide, is to click on the final slide.

    Also, once the photos cycle through, if the user does click on the final slide to advance to the first slide, the first slide just sits there, and the timer functionality does not kick in to automatically advance to the next slide.

    I'm at my wits' end. Please help.

  6. #6
    SnowKrash
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    32
    Okay, now I have the last slide going to the first slide. I did this:
    function goFirst(){
    _parent.rootSlide.gotoFirstSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goFirst, 4000);

    But I am still having a problem getting the slides to auto advance once the second cycle of slide play begins. I am using stop() on each slide's timeline, because if I don't, it's a mess, so do I now invoke play() somewhere?

    I apologize if this is a newbie problem. I have been using Flash for the first time, only three weeks now, and I'm starting with Flash 8 Pro, but if I can get some help on this, I won't bother the forum with this type of simple question again. I've just had a tough time making sense of the help with slides in the docs. Thanks in advance.

  7. #7
    SnowKrash
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    32
    it turns out that flash slide presentations have unique issues regarding focus. I used the following code, making it more specific to the slide I want, and it works. Hope this helps someone else, because no one should have to go through the tears I have shed.

    stop();
    function goNext(){
    _parent.currentSlide.gotoNextSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goNext, 4000);

  8. #8
    Junior Member
    Join Date
    Oct 2006
    Posts
    1
    I just found this thread and it saved me a lot of time. Thanks guys. Just a note to anyone else on here, it took me a while to figure where to put these bits of script. I've now sussed that by putting them within the action script for each screen. With a transitions on the screen, this gives me this:

    on (reveal) {

    // Transition behavior
    if (!eventObj.target._isSlide || (eventObj.target._isSlide && eventObj.target.currentSlide)) {
    mx.transitions.TransitionManager.start (eventObj.target,
    {type:mx.transitions.Blinds,
    direction:0, duration:2, easing:mx.transitions.easing.None.easeNone,
    numStrips:50, dimension:0});

    eventObj.target.__transitionManager._triggerEvent = eventObj.type;
    }
    // End Transition behavior
    stop();
    function goNext(){
    _parent.currentSlide.gotoNextSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goNext, 4000);
    }

    Now my only problem to figure out is how to keep the image from screen 1 as the background to the transition into screen 2!

    Thanks again guys.

  9. #9
    Junior Member
    Join Date
    Jan 2007
    Posts
    17

    Thank you for this thread!!

    I was having the same issue trying to understand how the slide show could work without interaction. Thank you SO much for posting that code, SnowKrash. It saved me a lot of time and frustration!

  10. #10
    Junior Member
    Join Date
    Jan 2007
    Posts
    2
    Quote Originally Posted by SnowKrash
    it turns out that flash slide presentations have unique issues regarding focus. I used the following code, making it more specific to the slide I want, and it works. Hope this helps someone else, because no one should have to go through the tears I have shed.

    stop();
    function goNext(){
    _parent.currentSlide.gotoNextSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goNext, 4000);
    Hi there, I need ur help for flash slide presentation.....I want to make auto slide presentation exactly like the way you have done it. Flash slide presentation document has slide 1 & slide 2 . Each slide has 2 child slides......I have used the same code which you had used for your client website......But some how I am still struggling to get it done....I have used code below:

    stop();
    function goNext(){
    _parent.currentSlide.gotoNextSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goNext, 4000)

    I will be greatful if u can help me ...

    Thanks

  11. #11
    Junior Member
    Join Date
    Jan 2007
    Posts
    2

    Flash autoplay slide presentation

    Quote Originally Posted by PAlexC
    You can use setInterval to set the time, in milliseconds, you want to wait until the slide advances.

    Try this code on the timeline of your slide, it'll advance to the next slide after 5 seconds.

    code:

    function goNext(){
    gotoNextSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goNext, 5000);

    Hi there,

    I need ur help regarding flash auto play slide presentation. I did try ur above code but some how I can see 2 slides and then it jump to last slide....

    I want to creat simple photo slide show using slide presentation feature....

    It would be great if u can give any idea....

    Thanks

  12. #12
    Junior Member
    Join Date
    Dec 2009
    Posts
    10

    resolved Thnx

    YES!
    @SnowKrash: - I had exactly the same issues, I posted my question on this forum with no answer. I guess it's all in the phrasing of the question. Many thanks.


    M.
    Last edited by Mipoiss; 12-15-2009 at 09:15 AM.

  13. #13
    Junior Member
    Join Date
    Dec 2009
    Posts
    10
    SnowKrash: I have the same problem.

    Your scoping does work and it brings the slideshow to the first slide. Thanks

    But my first slide has a timeline animation and goFirst() brings it on it's last frame, where it stops and doesn't execute the goNext().

    It would be fun if gotoAndPlay(1) worked after gotoFirstSlide() in the function but it doesn't.... There must be another way to Restart the whole slide show.

  14. #14
    Junior Member
    Join Date
    Dec 2009
    Posts
    10

    resolved Fixed!

    @SnowKrash & @edtaa:

    For all slides (with and without timeline animations) I put stop(); on the last keyframe of the timeline animation or on the first frame of no-timeline slides.

    The following code is put on the slide itself:


    on (hide) {

    // Transition behavior
    if (!eventObj.target._isSlide || (eventObj.target._isSlide && eventObj.target.currentSlide)) {
    mx.transitions.TransitionManager.start (eventObj.target,
    {type:mx.transitions.Fade,
    direction:1, duration:0.2, easing:mx.transitions.easing.None.easeNone,
    param1:empty, param2:empty});

    eventObj.target.__transitionManager._triggerEvent = eventObj.type;
    }
    // End Transition behavior

    }
    on (reveal) {

    // Transition behavior
    if (!eventObj.target._isSlide || (eventObj.target._isSlide && eventObj.target.currentSlide)) {
    mx.transitions.TransitionManager.start (eventObj.target,
    {type:mx.transitions.Fade,
    direction:0, duration:0.2, easing:mx.transitions.easing.None.easeNone,
    param1:empty, param2:empty});

    eventObj.target.__transitionManager._triggerEvent = eventObj.type;
    }
    // End Transition behavior

    gotoAndPlay(1)

    function goNext(){
    _parent.currentSlide.gotoNextSlide();
    clearInterval(timer);
    }
    var timer = setInterval(goNext, 4000);
    }

    On the last slide I replace the goNext() definition by the goFirst() one:

    function goFirst(){
    _parent.rootSlide.gotoFirstSlide();
    ;

    clearInterval(timer);
    }
    var timer = setInterval(goFirst, 4000);
    }

    It's the gotoAndPlay(1) that seems to do the trick "Restart" and the on hide transition that will get rid of the previous slide while revealing the current one. I have attached a short .FLA file that demos it.

    Thanks a million to the both of you for the input.
    Attached Files Attached Files
    Last edited by Mipoiss; 02-05-2010 at 02:57 PM.

  15. #15
    Junior Member
    Join Date
    Mar 2011
    Posts
    1

    Slide advance hotkey?

    I would like to be able to advance the slides in a Flash presentation without waiting for the slide to finish (the "Next" button does not light up enabling advancement until the slide plays out).

    Does anyone know a "hotkey" or way to advance slides before the slide finishes playing so I can test the presentation without watching the whole thing. It's a couple hours long (each slide around 2-5 mins) so I need to advance through the presentation to view it quicker.

    Thanks for any replies!

  16. #16
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    946
    onClipEvent(load){
    var keyListener:Object = new Object();
    keyListener.onKeyDown = function() {


    if (Key.isDown ( Key.PGDN)) {
    trace("down");
    // GoTo Next Screen behavior
    rootSlide.currentSlide.gotoPreviousSlide();




    }
    if (Key.isDown ( Key.PGUP)) {
    trace("up");
    rootSlide.currentSlide.gotoNextSlide();

    };
    Key.addListener(keyListener);a
    }


    Hope that helps
    Last edited by angelhdz; 11-26-2012 at 08:32 AM.
    Hi Object, Listen, i wish to return you something, but only if what you are saying is true, else, forget it, ROLL_OVER the floor, i will check for someone else at the stage, while eating a no.visible cookie.

  17. #17
    Member
    Join Date
    Aug 2012
    Posts
    53
    Ha Ha, is OK now I see it from the verb.

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

Poll by Flashkit.com