jdprepaprop
jdprepaprop

Reputation: 51

Create a scrollable non editable text display

I have very little experience with flex/actionscript3/mobile developement, but I'm currently working on a problem with an app, and find myself somewhat lost. In a legacy app I'm currently making modifcations to, we were previously using adobe Air 16, Flex 4.6. However, sometime ago an update was made to use Air 23 and Flex 4.15 instead.

Since then a couple of issues have come up, most notably a display we used is not longer working.

Previously we were using the following to display some information pulled from a log file for viewing by testers. The contents are added via the controller when the view is loaded up. That isn't included as it isn't particular important(at least I don't think it is).

<s:VGroup id="logPanel" horizontalAlign="center" width="100%" height="100%" paddingTop="15" paddingBottom="15" paddingLeft="15" paddingRight="15" gap="15">
    <s:TextArea id="logContents" width="100%" height="100%" editable="false" text="Opening file...">
    </s:TextArea>
</s:VGroup>

Previoulsy using the editable tag was enough to prevent the keyboard from popping up, and allow the mobile user to scroll through the text area via touching.

However, after updating this doesn't seem to be the case. In newer version the keyboard pops up and I can't seem to find a way to implement scrolling, and prevent the soft keyboard from appearing. It looks like the editable field is respected(as editing is enabled), but the prevent the soft keyboard via that tag isn't. I can disabled the soft keyboard via adding event listeners for a variety of Mouse events, but this doesn't seem ideal, and also doesn't help with scrolling.

Is their a simple way to get the functionality I want with this text area, or do I need to be using a different component for this entirely. After spending time trying to research this I keep coming back to text areas as the component I want, but as I mentioned getting the desired behavior is difficult, and I'm fairly new this language as a whole.

If I set enabled to false I am able to prevent the keyboard from appearing, but then I don't seem to be able to add event listeners to mouse inputs which I would need to manually implement scrolling.

Upvotes: 1

Views: 109

Answers (1)

jdprepaprop
jdprepaprop

Reputation: 51

The reason I was stumped was because I was being dumb. The text area doesn't seem to be able to behave the way the original authors intended anymore. However, the RichEditableText component was able to have the functionality I needed. Switched to the following game all the desired functionality. Had I not been so slow in going through documentation I might have found this sooner.

<s:VGroup id="contentPanel" horizontalAlign="center" width="100%" height="100%" paddingTop="15" paddingBottom="15" paddingLeft="15" paddingRight="15" gap="15">
    <s:Scroller width="100%" height="80%">
        <s:RichEditableText id="contents" percentWidth="100" percentHeight="100" editable="false" selectable="false">
        </s:RichEditableText>
    </s:Scroller>
</s:VGroup>

Upvotes: 1

Related Questions