A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Reload/Restart Slide in Slide Presentation

  1. #1
    Junior Member
    Join Date
    May 2007
    Posts
    14

    Reload/Restart Slide in Slide Presentation

    Quick Question. I'm using flash CS3 and making a flash slide presentation. How do I make it so when i press the "next slide" button, that the "next slide" starts from the first frame each time? Right now, when I have it set, if it has already played once, it stays at the end.

    I'd like to to start from frame 1 each time I click next, or previous, and each time it does so. So that it automatically reloads that slides contents each time I go to that slide.

    Right now, each "next slide" button only has:

    Code:
    on (release) {
    
    	  // GoTo Next Screen behavior
          var screen = null;
          var target = this;
          while((screen == null) && (target != undefined) && (target != null))
          {
            if(target instanceof mx.screens.Screen)
            {
              screen = target;
            }
            else
            {
              target = target._parent;
            }
          }
          if(screen instanceof mx.screens.Slide)
          {
            screen.rootSlide.currentSlide.gotoNextSlide();
          }
    	  // End GoTo Next Screen behavior
    
    }

  2. #2
    Junior Member
    Join Date
    May 2007
    Posts
    14
    bump?

  3. #3
    :
    Join Date
    Dec 2002
    Posts
    3,518

    Maybe try something like this...

    // part of code on next button
    if (screen instanceof mx.screens.Slide)
    {
    screen.rootSlide.currentSlide.nextSlide.gotoAndPla y (1);
    screen.rootSlide.currentSlide.gotoNextSlide();
    }

    // part of code on previous button
    if (screen instanceof mx.screens.Slide)
    {
    screen.rootSlide.currentSlide.previousSlide.gotoAn dPlay (1);
    screen.rootSlide.currentSlide.gotoPreviousSlide();
    }

  4. #4
    Junior Member
    Join Date
    May 2007
    Posts
    14
    I think I'm confused by this part:

    if (screen instanceof mx.screens.Slide)

    How do I modify that to work with the movie?


    edit: nevermind, I see what you're talking about... lemme try that.
    edit 2: YES it does work, I switched the code to look like this:

    Code:
    on (release) {
    
    	  // GoTo Next Screen behavior
          var screen = null;
          var target = this;
          while((screen == null) && (target != undefined) && (target != null))
          {
            if(target instanceof mx.screens.Screen)
            {
              screen = target;
            }
            else
            {
              target = target._parent;
            }
          }
          if(screen instanceof mx.screens.Slide)
          {
         
    		screen.rootSlide.currentSlide.nextSlide.gotoAndPlay (1);
    		screen.rootSlide.currentSlide.gotoNextSlide();
    		
          }
    	  // End GoTo Next Screen behavior
    Thanks so much, now I have to figure out why my sounds don't stop when I click the button now.
    Last edited by gametavern; 07-25-2007 at 11:34 AM.

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