|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import krpano_as3_interface;
var krpano:krpano_as3_interface = null;
this.addEventListener(Event.ADDED_TO_STAGE, startplugin);
function startplugin(evt:Event):void
{
// get interface to krpano
krpano = krpano_as3_interface.getInstance();
// first - disable the build-in progressbar
krpano.set("progress.showload","none");
krpano.set("progress.showwait","none");
// check every frame if krpano is loading something
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
function enterFrameHandler(event:Event):void
{
if( krpano.get("progress.isloading") == true )
{
// bytesloaded/bytestotal are the number of bytes currently loaded and total
// note - for tiled and multiresolution panoramas these value can vary quickly!
// better use the "progress" value in this case!
var bytesloaded:Number = Number( krpano.get("progress.bytesloaded") );
var bytestotal:Number = Number( krpano.get("progress.bytestotal") );
// "progress" is a value between 0.0 and 1.0
var progress:Number = Number( krpano.get("progress.progress") );
// draw/scale something with this value
...
}
}
|
|
|
Quellcode |
1 |
<plugin name="myloader" url="myloader.swf" preload="true" keep="true" /> |
|
|
Quellcode |
1 2 3 4 5 6 7 |
var progressbarwidth:Number = 300; // calc left offset of image: image.x = stage.stageWidth/2 - progressbarwidth/2; // calc width (depending on the progress): image.width = progress * progressbarwidth; |

|
|
Quellcode |
1 |
<plugin name="loader" url="progress.swf" keep="true" align="leftcenter" /> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 |
function startup_plugin(event:Event):void
{
// first krpano calls - disable default progressbar
krpano.set("progress.showload","none");
krpano.set("progress.showwait","none");
// here, other code...
}
|
|
|
Quellcode |
1 |
<plugin name="loadingBarPerso" url="data/graphics/loderPerso.swf" preload="true" keep="true"/> |
use the MERGE or KEEPALL or KEEPPROGRESS flags in the loadpano() call,it is a KRpano bug ? or do you have a specific function for desactivate theses bar all the time ?