Hello,
I'm working on a progressBar for the loading of several local files in an AIR app. I am sending notifications out of a loop that runs on every line of a file that has loaded. I can't, for the life of me, get the progressbar to visually update, and was wondering if something may be weird with the way notifications work. Do they dispatch events and run asynchronously with the execution thread or are they fired synchronously. From what I've seen it looks pretty sycronous because I set breakpoints in my setProgress function which is supposed to update the progressBar. I've tried just about everything with the progressBar, manual mode, event mode (dispatching my own ProgressEvents, etc.) and nothing will work. I'm running mac os x10.4 and compiling for flash player 9. Anybody have any ideas. Here is a code snippet from where I'm updating the progressbar. I know this post goes a little outside of PureMVC, but thought maybe, somewhere it has something to do with it, or at least it is worth my time asking.
Like I said, I can verify, through breakpoints, that setPercentage is getting called, but no visual result displayed.
<mx:Module xmlns:mx="
http://www.adobe.com/2006/mxml">
<!--<mx:Dissolve id="myShow" duration="500" alphaFrom="0.0" alphaTo="1.0"/>-->
<mx:Box>
<mx:Script>
<![CDATA[
import com.widgetmakers.coolwidget.globals.MessageStrings;
[Bindable] private var progressLabel:String = MessageStrings.EXTRACTING_INVOICE_INFO;
public function setPercentage(thePercentage:Number):void {
var theP:Number = Math.round(thePercentage);
this.bar.setProgress( theP, 100 );
}
]]>
</mx:Script>
<mx:VBox>
<mx:ProgressBar id="bar" labelPlacement="bottom" themeColor="#F20D7A"
minimum="0" visible="true" maximum="100" label="{this.progressLabel}"
direction="right" mode="manual" width="100%"/>
</mx:VBox>
</mx:Box>
</mx:Module>