Search code examples
multithreadingactionscript-3apache-flexactionscriptflash-builder

Actionscript - Flex mobile thread while loading data?


I am using Flash builder actionscript 3 Flex mobile. I have a very heavy function that loads data from the local device and creates many graphic elements. While this function runs, the device freezes for 6 seconds or so. I want to show a progress bar and let the device continue working, is there any way I can use threading to do this ? Other ideas are also welcome.

Thanks, Koby.


Solution

  • You know that at which function application getting freeze. Before that function call a progress bar. Create a progress bar in a pop up mode & call it. After 6 seconds(Not recommended) or getting the data just call removeallpopups() method. So now you can set the label in progress bar as "Loding..."

    Sample code

    <mx:ProgressBar id="sampleProgressBar" styleName="Calib16Blue"
                        indeterminate="true" labelPlacement="left"
                        label="{theMessage}"/>
    

    Call this mxml by creating a pop up.