Jenna
Jenna

Reputation: 1

Scrollbar in Flex/FlashBuilder application around set of content?

I'm having a bit of trouble programming a scrolling screen for an application I'm building in Flash Builder 4.7. I'd like to program so the map (images/ThirdFloor.png) doesn't scroll but the description does (images/FloorThreeGuide.png). Is there any possible way to do this? or can I only make the whole screen scroll? Thanks!

Code without scrollbar:

    <?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" title="Level Three">

    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>

    <s:HGroup>
        <!--this is a background image-->
        <s:Image source="images/background.png" height="100%" width="100%">
        </s:Image>
    </s:HGroup>

    <s:VGroup width="100%" height="100%" verticalAlign="top" horizontalAlign="left">
        <!--this tells the app to go back to the main page-->
        <s:Button chromeColor="0x9b063a" label="Home" color="0xffffff" click="navigator.popView()" styleName="back" width="100%" />
        <!--this is the third floor map-->
        <s:Image source="images/ThirdFloor.png"  width="100%" height="100%">
        </s:Image>

<!-- this is the section I want to scroll -->
        <s:Group>
        <!--this is a description for the floor exhibits-->
        <s:Image source="images/FloorThreeGuide.png" width="100%" height="100%">
        </s:Image>
        </s:Group>
    </s:VGroup>
</s:View>

This is what the code looks like when it's simulated to play on the device - click for image:

1

Upvotes: 0

Views: 122

Answers (1)

Brian
Brian

Reputation: 3914

You can wrap your Group in a Scroller:

<!-- this is the section I want to scroll -->
<s:Scroller>
    <s:Group>
        <!--this is a description for the floor exhibits-->
        <s:Image source="images/FloorThreeGuide.png" width="100%" height="100%">
        </s:Image>
    </s:Group>
<s:Scroller>

Upvotes: 1

Related Questions