Hi, can i get the moment of full loaded content of panoramic?
i've read onstart, but it works when load xml but not img.
thanks
onLoaded, xml and full secuency of images of pano
-
-
depending upon what you want to the "wait" action may work?
-
Hi,
at the moment there is no real event for "loading finished" because when using tiled or multiresolution panoramas it can happen that it loads new needed tiles later...
or use the "wait(LOAD);" action to wait until all images or all tiles for the first view (on multiresolution panoramas) are loaded,
or if you are in as3 / a plugin you can check the "progress.loaddone" variable with a Timer...
I have planned to make two new events in the next versions:
"events.onviewdone" - when all images/tiles are loaded for the current view (for multiresolution and normal panoramas)
"events.onloaddone" - when really all images are loaded (only useable for normal panoramas)what do you think about them? or any further proposals?
best regards,
Klaus -
Dear Sir,
Around line 353 in flashcs3exampleplugin1.fla you offer with the package, you wrote:
..................................................
if ( krpano.get("progress.loaddone") == "false" )
{
// show progressbar
this.progressbar.visible = true;// NOTE - this works only for simple one image panoramas
// when there are more images, the calculation of the download progress
// is more complexvar bytesloaded:Number = Number( krpano.get("progress.bytesloaded") );
var bytestotal:Number = Number( krpano.get("progress.bytestotal") );
..................................Could you please explain how can I predict multiple images downloading. In other words, I have front, left, right, top,down, etc... and need to predict the loading of all these images.
Could you help please?Thanks,
Wesam -
Hi,
calculating the download progress is a little bit complicated at the moment,
because of the multi-resolution loading it's difficult to show a correct progress.have a look at the "krpano.progress.*" values here:
here a quick explanation of these values:
progress.loaddone
- while loading "false", when done "true"progress.bytesloaded
- sum of bytes from all files that are current downloading
(see the value set in "network.downloadqueues" for how many files are
max. loading at the same time, if you set it to 1 it would be a little
bit easier to calculate a good progress value)progress.bytestotal
- sum of all total bytes from all files that are current downloadingprogress.filesloaded
- number of files are already downloaded (for the current level)progress.filestotal
- total files (for the current level)progress.filesneeded
- files that are needed to be downloaded for the current viewprogress.decodesneeded
- each image must also be decoded
- this is the number of files that needed to be decoded for the current viewfrom these values the current progress can be calculated,
this is my current implementation in the viewer: (not optimal)
Code
Alles anzeigen// because the current number of files that are needed // is changing very fast, I save the latest maxium of the // filesneeded value: public var lastmax_filesneeded:int = 0; // global or static var! // now here the code that draws a progress bar or something else: // call it in a enterframe or timer loop: if (krpano.get("progress.loaddone") != "true") { bytesloaded = int( krpano.get("progress.bytesloaded") ); bytestotal = int( krpano.get("progress.bytestotal") ); var bytes_progress:Number = 0.0; if (bytestotal > 0) { bytes_progress = Number(bytesloaded+1) / bytestotal; } var filestotal :int = int( krpano.get("progress.filestotal") ); var filesneeded :int = int( krpano.get("progress.filesneeded") ); if (filesneeded > lastmax_filesneeded) { lastmax_filesneeded = filesneeded; } else if (filesneeded == 0) { lastmax_filesneeded = 0; } if (filestotal > 0) { progress = 1.0; } if (lastmax_filesneeded > 0) { progress = 1.0 - Number(filesneeded-1 + (1.0 - bytes_progress))/lastmax_filesneeded; } // now draw a progress bar - the progress value is now between 0.0 and 1.0 }
but note - this is not a really good algorithm at the moment
it will be improved next,best regards,
Klaus
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!