Loading ...
Sorry, an error occurred while loading the content.

Carousel: scrollToIndex

Expand Messages
  • Jason
    If I m simply using a BoxCellRenderer and have a simple button that I want to use to navigate (scroll) through the carousel items one at a time - WITHOUT
    Message 1 of 5 , Aug 8 10:15 AM
    • 0 Attachment
      If I'm simply using a BoxCellRenderer and have a simple button that I want to use to navigate (scroll) through the carousel items one at a time - WITHOUT changing the selected item, wouldn't I simply do something like...

      myCarousel.scrollToIndex(1);

      What am I missing here? That's not working.

      I'm assuming the argument - newCaretIndex - is the index of the item in the list I want to move the carousel to.

      Interestingly enough, the default value for the property 'caretIndex' is -1.

      Gonna do some additional digging, but any assistance would be greatly appreciated.

      Thank you.
    • Josh Tynjala
      The Carousel itself doesn t have the ability to scroll. It s the skin that scrolls or changes layout. If you re familiar with Flex, the Carousel is like the
      Message 2 of 5 , Aug 8 10:21 PM
      • 0 Attachment
        The Carousel itself doesn't have the ability to scroll. It's the skin that scrolls or changes layout. If you're familiar with Flex, the Carousel is like the Spark List. You can skin it to look like something that doesn't even have the ability to scroll. I'm not looking at the code now, but I think the skin with the box layout makes selectedIndex and scrolling the same thing. You'll probably need to create a custom skin if you want to decouple them.

        Unfortunately, things like scrollToIndex(), verticalScrollPosition, horizontalScrollPosition and stuff like that get inherited from SelectableList, and that can make it confusing. They get ignored because the Carousel cannot assume much about how the skin implements navigation/scrolling/layout. Ideally, scrollToIndex() and all of the related properties and methods should have been hidden with metadata.

        - Josh

        On Mon, Aug 8, 2011 at 10:15 AM, Jason <jlampitt@...> wrote:
         

        If I'm simply using a BoxCellRenderer and have a simple button that I want to use to navigate (scroll) through the carousel items one at a time - WITHOUT changing the selected item, wouldn't I simply do something like...

        myCarousel.scrollToIndex(1);

        What am I missing here? That's not working.

        I'm assuming the argument - newCaretIndex - is the index of the item in the list I want to move the carousel to.

        Interestingly enough, the default value for the property 'caretIndex' is -1.

        Gonna do some additional digging, but any assistance would be greatly appreciated.

        Thank you.


      • Josh Tynjala
        By the way, when I say skin here, I m referring to the layoutRenderer . - Josh
        Message 3 of 5 , Aug 8 10:25 PM
        • 0 Attachment
          By the way, when I say "skin" here, I'm referring to the "layoutRenderer".

          - Josh

          On Mon, Aug 8, 2011 at 10:21 PM, Josh Tynjala <joshtynjala@...> wrote:
          The Carousel itself doesn't have the ability to scroll. It's the skin that scrolls or changes layout. If you're familiar with Flex, the Carousel is like the Spark List. You can skin it to look like something that doesn't even have the ability to scroll. I'm not looking at the code now, but I think the skin with the box layout makes selectedIndex and scrolling the same thing. You'll probably need to create a custom skin if you want to decouple them.

          Unfortunately, things like scrollToIndex(), verticalScrollPosition, horizontalScrollPosition and stuff like that get inherited from SelectableList, and that can make it confusing. They get ignored because the Carousel cannot assume much about how the skin implements navigation/scrolling/layout. Ideally, scrollToIndex() and all of the related properties and methods should have been hidden with metadata.

          - Josh


          On Mon, Aug 8, 2011 at 10:15 AM, Jason <jlampitt@...> wrote:
           

          If I'm simply using a BoxCellRenderer and have a simple button that I want to use to navigate (scroll) through the carousel items one at a time - WITHOUT changing the selected item, wouldn't I simply do something like...

          myCarousel.scrollToIndex(1);

          What am I missing here? That's not working.

          I'm assuming the argument - newCaretIndex - is the index of the item in the list I want to move the carousel to.

          Interestingly enough, the default value for the property 'caretIndex' is -1.

          Gonna do some additional digging, but any assistance would be greatly appreciated.

          Thank you.



        • Jason
          Seems like the documentation is incorrect then b/c the method scrollToIndex() is defined as a method of the Carousel, not SelectableList. In the Carousel
          Message 4 of 5 , Aug 9 11:45 AM
          • 0 Attachment
            Seems like the documentation is incorrect then b/c the method scrollToIndex() is defined as a method of the Carousel, not SelectableList.

            In the Carousel class, scrollToIndex overrides the method defined in fl.controls.SelectableList.

            So, just observations... Not really sure what direction I'm going to go, but creating a custom skin per your recommendation is probably the best course of action.

            --- In ydn-flash@yahoogroups.com, Josh Tynjala <joshtynjala@...> wrote:
            >
            > The Carousel itself doesn't have the ability to scroll. It's the skin that
            > scrolls or changes layout. If you're familiar with Flex, the Carousel is
            > like the Spark List. You can skin it to look like something that doesn't
            > even have the ability to scroll. I'm not looking at the code now, but I
            > think the skin with the box layout makes selectedIndex and scrolling the
            > same thing. You'll probably need to create a custom skin if you want to
            > decouple them.
            >
            > Unfortunately, things like scrollToIndex(), verticalScrollPosition,
            > horizontalScrollPosition and stuff like that get inherited from
            > SelectableList, and that can make it confusing. They get ignored because the
            > Carousel cannot assume much about how the skin implements
            > navigation/scrolling/layout. Ideally, scrollToIndex() and all of the related
            > properties and methods should have been hidden with metadata.
            >
            > - Josh
            >
            > On Mon, Aug 8, 2011 at 10:15 AM, Jason <jlampitt@...> wrote:
            >
            > > **
            > >
            > >
            > > If I'm simply using a BoxCellRenderer and have a simple button that I want
            > > to use to navigate (scroll) through the carousel items one at a time -
            > > WITHOUT changing the selected item, wouldn't I simply do something like...
            > >
            > > myCarousel.scrollToIndex(1);
            > >
            > > What am I missing here? That's not working.
            > >
            > > I'm assuming the argument - newCaretIndex - is the index of the item in the
            > > list I want to move the carousel to.
            > >
            > > Interestingly enough, the default value for the property 'caretIndex' is
            > > -1.
            > >
            > > Gonna do some additional digging, but any assistance would be greatly
            > > appreciated.
            > >
            > > Thank you.
            > >
            > >
            > >
            >
          • Josh Tynjala
            You re right, scrollToIndex() is overridden in Carousel. I m not sure what it s meant to be doing, though. I wrote that class several years ago, and it was a
            Message 5 of 5 , Aug 9 12:47 PM
            • 0 Attachment
              You're right, scrollToIndex() is overridden in Carousel. I'm not sure what it's meant to be doing, though. I wrote that class several years ago, and it was a bit rushed, so my memory is a bit hazy now.

              By the way, there are several issues in Carousel from Astra 1.4. Some of them got fixed in the patch I made available here:


              That may not be all of them, though. I made a number of bugfixes while using Carousel in a client project. I intend to put my latest source up on Github when I get a chance.

              - Josh

              On Tue, Aug 9, 2011 at 11:45 AM, Jason <jlampitt@...> wrote:
               

              Seems like the documentation is incorrect then b/c the method scrollToIndex() is defined as a method of the Carousel, not SelectableList.

              In the Carousel class, scrollToIndex overrides the method defined in fl.controls.SelectableList.

              So, just observations... Not really sure what direction I'm going to go, but creating a custom skin per your recommendation is probably the best course of action.



              --- In ydn-flash@yahoogroups.com, Josh Tynjala <joshtynjala@...> wrote:
              >
              > The Carousel itself doesn't have the ability to scroll. It's the skin that
              > scrolls or changes layout. If you're familiar with Flex, the Carousel is
              > like the Spark List. You can skin it to look like something that doesn't
              > even have the ability to scroll. I'm not looking at the code now, but I
              > think the skin with the box layout makes selectedIndex and scrolling the
              > same thing. You'll probably need to create a custom skin if you want to
              > decouple them.
              >
              > Unfortunately, things like scrollToIndex(), verticalScrollPosition,
              > horizontalScrollPosition and stuff like that get inherited from
              > SelectableList, and that can make it confusing. They get ignored because the
              > Carousel cannot assume much about how the skin implements
              > navigation/scrolling/layout. Ideally, scrollToIndex() and all of the related
              > properties and methods should have been hidden with metadata.
              >
              > - Josh
              >
              > On Mon, Aug 8, 2011 at 10:15 AM, Jason <jlampitt@...> wrote:
              >
              > > **
              > >
              > >
              > > If I'm simply using a BoxCellRenderer and have a simple button that I want
              > > to use to navigate (scroll) through the carousel items one at a time -
              > > WITHOUT changing the selected item, wouldn't I simply do something like...
              > >
              > > myCarousel.scrollToIndex(1);
              > >
              > > What am I missing here? That's not working.
              > >
              > > I'm assuming the argument - newCaretIndex - is the index of the item in the
              > > list I want to move the carousel to.
              > >
              > > Interestingly enough, the default value for the property 'caretIndex' is
              > > -1.
              > >
              > > Gonna do some additional digging, but any assistance would be greatly
              > > appreciated.
              > >
              > > Thank you.
              > >
              > >
              > >
              >


            Your message has been successfully submitted and would be delivered to recipients shortly.