0
votes

i am flashAs3.0 developer but am new to flex.Can anyone help me how to Create a Horizontal scroll-er in list view by adding images dynamically.i am using flash builder 4.6.

here i tried this code.but i need to Create a Horizontal scroll-er in list view by adding images dynamically.Help me regarding this pls.Thanks in advance

<s:Scroller width="100" height="100">
       <s:Group> 
          <mx:Image width="300" height="400" 
               source="@Embed(source='assets/logo.jpg')"/> 
       </s:Group>        
</s:Scroller>
2

2 Answers

0
votes

You may need to add the following arguments to your scroller:

<s:Scroller horizontalScrollPolicy="on" verticalScrollPolicy="on">

These should force the scroll bars to appear, if you still can't scroll then the container inside the scroller isnt setting it's height and width correctly, try:

   <s:Scroller horizontalScrollPolicy="on" verticalScrollPolicy="on" height='150' width='150'>
    <s:Group height='100%' width='100%'>
    <s:Image height='400' width='300'/>

The group should size itself to it's children and as the scrollers viewport it should create the correct scroll area.

0
votes

Im not completely sure the situation you are describing. With your current code a horizontal scroll bar is added to the image. If you add more images dynamically and you want them to stack horizontally then you will need to use an HGroup instead of a normal group.

<s:Scroller width="100" height="100">
   <s:HGroup> 
      <mx:Image width="300" height="400" 
           source="@Embed(source='assets/logo.jpg')"/> 
   </s:HGroup>        
</s:Scroller>

This is how I understood your question. My apologies if I am off track.

Good luck.