philipSe
|
|
« Reply #1 on: March 10, 2010, 04:37:50 » |
|
For a group of assets, to be loaded via the asset loader facility, Loadup prefers to calculate the percent loaded on the basis of bytes loaded versus the total to be loaded, as opposed to a simple number of assets loaded versus the total number of assets. It relies on the information provided by the ProgressEvents that occur within the load process for each asset. However, the bytes total (total size) for an asset can only be known when loading of that asset has commenced.
The loading occurs asynchronously; several assets can be undergoing load simultaneously. However, until all of the loads have commenced, the overall total bytes is not known, and hence progress on the exact bytes basis cannot be reported. So, until that point has been reached, the percentage is calculated on the basis of the percent loaded per asset, averaged across the total number of assets. For example, assets A,B,C,D. A is 75% loaded, B is 25% loaded, C and D not started. The reported progress percentage is (75+25)/4 = 25%. Then, when C and D have started, the reported percentage is based on the exact bytes. Now, if C and D turn out to be large relative to A and B, a drop in the reported percentage will be observed.
If a progress percentage, based on number of assets loaded versus the total number of assets, is preferred, use the Loadup.LOADING_PROGRESS notification instead of the Loadup.ASSET_GROUP_PROGRESS notification.
Hope this helps. ----Philip
|