Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Actually, your problem is not about Flash running line by line. In fact, it does run line by line, but your problem is that you want to see the text change before running the function. See the change text differs from changing the text. Your code actually changes the text, but the interface hasn't been changed yet through the eventDispatcher. If you're running on SDK 3.6A or newer, you can listen to afterChange event and call your function after the screen has been updated.</p> <p>Edit: Your code "doesn't work" because since the execution of your function is so fast, it doesn't give the screen time to update to "Processing" before the map is already done, which makes it looks like the screen has been updated only once.</p> <p>Edit 2: Here is a working code (note: You'll only see a glimpse of the "Waiting..." message because the process is too fast): </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&gt; &lt;mx:Script&gt; &lt;![CDATA[ import mx.controls.Alert; // Function that starts everything private function changeValue():void{ // Add Listener to the label to wait the screen to be updated BEFORE updating the text. this.status.addEventListener(Event.RENDER, this.changed); // Update the text this.status.text = "Wait..."; } private function changed(e:Event):void{ // Make sure to remove the eventListener to not cause infinite loop. this.status.removeEventListener(Event.RENDER, this.changed); // Make new change. this.status.text = "Done"; } ]]&gt; &lt;/mx:Script&gt; &lt;mx:Button x="221" y="185" label="Change it!" click="changeValue()"/&gt; &lt;mx:Text id="status" x="395" y="250" text="Text"/&gt; &lt;/mx:Application&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload