Using paragraph scrollbar as slider

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • yosik
    Indigo Rose Customer
    • Jun 2002
    • 1858

    Using paragraph scrollbar as slider

    Hi,
    The slider plugin beeing soooo standard, I thought about using the paragraph scrollbar as a slider.
    I am trying to get scrollbar position, as compared to scrollbar range to be able to get a percentage slider and use it to control another object (video, flash etc..).
    I am trying..but not succeeding.
    The idea was to do the following:

    scrollrange = Paragraph.GetScrollRange("Paragraph1", false);
    scrollpos = Paragraph.GetPos("Paragraph1");
    framenumber=scollpos/(scrollrange[2]-scrollrange[1]);
    Flash.Seek("3D", SEEK_SPECIFIC, framenumber);

    Furthermore, let's say that I could do that (with your help, please..), how can I get a realtime response? I can only put this set of actions in a onClick or onEnter event. How can I constantly read the scrollbar position?

    Thanks
    Yossi
  • Lorne
    Indigo Rose Staff Member
    • Feb 2001
    • 2729

    #2
    Try one of these:

    framenumber = total_frames * scrollpos / scrollrange

    framenumber = total_frames * scrollpos / scrollrange + 1


    Nice idea btw.
    --[[ Indigo Rose Software Developer ]]

    Comment

    • Corey
      Indigo Rose Staff Alumni
      • Aug 2002
      • 9745

      #3
      That's a dang good idea, it's downright Yosstastic!

      *Edit* Actually I like this one so much that I am going to do something I've never, ever done before, I'm going to post a golden thumb.

      Corey Milner
      Creative Director, Indigo Rose Software

      Comment

      • kpsmith
        Forum Member
        • Jul 2000
        • 332

        #4
        Now why didn't I think of that when I did the Image Slider Project . Didn't realize I could control the scrollbar like that...

        Guess I need to go back and RTFM again.

        Comment

        • TJ_Tigger
          Indigo Rose Customer
          • Sep 2002
          • 3159

          #5
          Yosstastic. I will have to remember that one.
          TJ-Tigger
          "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
          "Draco dormiens nunquam titillandus."
          Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

          Comment

          • Lorne
            Indigo Rose Staff Member
            • Feb 2001
            • 2729

            #6
            Re: Using paragraph scrollbar as slider

            Originally posted by yosik
            Furthermore, let's say that I could do that (with your help, please..), how can I get a realtime response? I can only put this set of actions in a onClick or onEnter event. How can I constantly read the scrollbar position?
            The page's On Timer event should do the trick.
            --[[ Indigo Rose Software Developer ]]

            Comment

            • Lorne
              Indigo Rose Staff Member
              • Feb 2001
              • 2729

              #7
              It works.

              Here's a quick example project.

              Note that the slider's range is controlled by the number of lines of text in the paragraph object.

              You'll probably want to tweak the calculations so it reaches 100% when the slider is at the end, but I'll leave that as an exercise for someone with more time on their hands.
              Attached Files
              --[[ Indigo Rose Software Developer ]]

              Comment

              • yosik
                Indigo Rose Customer
                • Jun 2002
                • 1858

                #8
                Ok guys,
                Thanks for the kudos.
                I like yosstastic too :-)
                Am outta office, but will try it first thing monday.
                I LOVE this forum!!
                Yossi

                Comment

                Working...
                X