ProgressBarbetween OS X and Windows when the
mode = ProgressBarMode.MANUALand
indeterminate = true.
To illustrate this, we'll start with the following MXML component:
<mx:progressbar x="10" y="10" id="progress" labelplacement="bottom" indeterminate="true" enabled="true" minimum="0" maximum="100" label="" width="210"/>
With some styling applied, the result is this:
Now, let's say that we want to use the
ProgressBarfor some non-indeterminate (er, determinate) purpose, like loading some data from a server. So, let's do this:
progress.indeterminate = false;
progress.mode = ProgressBarMode.MANUAL;
someLoaderwill load something, and
someProgressListenerwill keep us up-to-date about the progress. So, say we've loaded all the data and now we're doing some processing, the progress of which we don't know since our processing function is synchronous and does not dispatch
ProgressEvents. So, we want to set
indeterminateback to true so that our users will know something is still happening but not show possibly incorrect progress with a determinate
ProgressBar. So, let's do this:
progress.indeterminate = true;
WTF! Now our
ProgressBarlooks like this:
In Firefox and IE on Windows, the
ProgressBarlooks identical to before, which is the expected behavior. But in Safari (at least) on OS X, we have this monstrosity. What happened? Shouldn't Flash look identical in any browser? Well, apparently it doesn't.
Fortunately, this isn't unfixable. In fact, it's a very simple fix, though it makes zero sense to me why this changes the visual display. Just set
progress.mode = ProgressBarMode.EVENT. Turns out that this ugly displacement only occurs in OS X
if (progress.mode == ProgressBarMode.MANUAL && progress.indeterminate). Oh well, something to chalk up on the list of cross-browser differences in Flash.
On another note, remember that
progress.setProgress(num,total)will not do anything unless you have set
progress.mode = ProgressBarMode.MANUAL. This is another thing I think is ridiculous, but the
ProgressBarwill ignore any calls to
mode != ProgressBarMode.MANUAL. I understand that the different
ProgressBarModesettings will instruct the
ProgressBarwhere to expect progress changes from, but it still seems odd to fully ignore calls to
setProgressWITHOUT throwing any kind of error or warning when
mode != ProgressBarMode.MANUAL.
Versions: This was discovered in OS X 10.5, Flash MAC 10.0.12.36 (debug), Safari 3.2.1.