2 Replies Latest reply on Nov 14, 2010 4:10 PM by bigredbeard

    Scroll Rect broken /  bug?

    bigredbeard

      Hello all, I am trying to use a HSlider to navigate a s:List component in flex and having a hard time.  Now before you say "But Andrew, you could just use a scroll bar" that is not what i want because it will not allow me to do the animations that i require.  So that being said,  i have the following code:

       

      [CODE]

      <?xml version="1.0" encoding="utf-8"?>

       

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

       

                        xmlns:s="library://ns.adobe.com/flex/spark"

       

                        xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

       

           <fx:Declarations>

       

           </fx:Declarations>    

       

      <fx:Script>

       

           <![CDATA[

       

      public function init2():void{

       

                     dog.graphics.beginFill(0xff0000);

       

                     dog.graphics.drawCircle(200,200,200 );

       

                     dog.scrollRect = new Rectangle(0,0,100,100);

       

                }

       

           ]]>

       

      </fx:Script>

       

      <s:Group id="dog" creationComplete="init2()">

       

                <s:HGroup>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                </s:HGroup>

       

                <s:VGroup>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                <s:Label text="dog"/>

       

                </s:VGroup>

       

           </s:Group>

      [/CODE]

       

      Which succesfully applies a scroll rect to the square, i see part of the red circle, and a few dogs.  Then, when i add

       

      [CODE]

      <s:List dataProvider="{oData}">

      </s:List>

      [/CODE]

       

      after the VGroup, everything breaks, scroll rect no longer is applied (een though i see it if i trace it out), and i see all of everything...  anyone see something that i am blatently missing?  Any help would be apprecaited.

       

       

      The only way i see around this is attaching a HScrollBar to the group'dog' and then making the HScrollbar visible=false.  This forces a scroll rect to the size i would like.

       

       

      Thanks - Andrew