Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34391

ScrollableStageText with large y value crashes app




      When calculating the global viewport during the initial layout of a ScrollableStageText component, the y value can exceed the maximum allowed y value of StageText, causing the app to crash. The exact y value required to crash it varies based on scale, but globally, 8192 is the breaking point. This became an issue for me when placing user generated content with text inputs within a scroller.

      To replicate:
      1) Create a new application
      2) Place a TextInput control inside the view with a large y value (~10,000)
      3) Run the app and see it crash

      I have included a sample mobile application that demonstrates this issue and a workaround I used to fix it. As a workaround, I extend ScrollableStageText and override getGlobalViewPort, setting the y value to the min of the globalRect.y and stage.stageHeight, and the same for the x value as well.

      This issue is also reproduced in the case:

      <s:TextInput width="250" height="190" text="One"/>
      <s:TextInput width="250" height="190" text="Two"/>
      //Large number of text inputs (25+ depending on the size of the device)
      <s:TextInput width="250" height="190" text="Twenty Eight"/>


        1. ScrollableStageTextTest.fxp
          14 kB
          Colin Childs



            • Assignee:
              bigosmallm Om
              cchilds Colin Childs
            • Votes:
              1 Vote for this issue
              3 Start watching this issue


              • Created: