Wow, great interface !
Would you share your flash hotspot and loader plugin ?
Just one thing, your html5 textfields should fit the content in height, it's a bit strange with all thoses blank spaces.
Great work !
Hi, thank you very much! Sorry for the delayed answer.
I shared basic code lines for my hotspot plugin here:
Smarter hotspots - dynamic scene title on rollover and looktohotspot with dynamic hotspot name
Loader plugin isn't complicated - I used separate class for the loader circle which includes setProgress() and drawWedge() functions.
The plugin itself uses krpano onnewpano event to listen when new scene is loaded
|
Quellcode
|
1
2
3
4
5
6
7
8
|
public function registerplugin(krpanointerface:Object, pluginfullpath:String, pluginobject:Object):void {
_krpano.set("progress.showload","none");
_krpano.set("progress.showwait","none");
_krpano.set("events[myevents_"+ _plugin.name + "].onnewpano", onNewPano);
_krpano.set("events[myevents_"+ _plugin.name + "].keep", true);
onNewPano();}
|
and uses timer to update loader wedge regarding to percentage
|
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
private function onNewPano(...rest):void
{
_krpano.trace(1, _plugin.name + " onnewpano() called with " + rest.length + " arguments:");
if (_refreshTimer != null) {
_refreshTimer.stop();
_refreshTimer.removeEventListener(TimerEvent.TIMER, onProgress);
_refreshTimer = null;
}
_refreshTimer = new Timer(100);
_refreshTimer.addEventListener(TimerEvent.TIMER, onProgress);
_refreshTimer.start();
if (!_meter) {
_meter = new Meter();
_meter.x = stage.stageWidth/2;
_meter.y = stage.stageHeight/2;
}
if (!contains(_meter) || !_meter.visible)
show();
}
private function onProgress(e:TimerEvent):void {
if (!_meter)
return;
var progress:Number = 1;
if(_krpano.get("progress.isloading")) {
progress = Number(_krpano.get("progress.progress") );
(progress < 0) ? progress=0 : null;
(progress > 1) ? progress=1 : null;
_meter.setProgress(progress);
}
if (_krpano.get("progress.loaddone") || progress >= 1) {
_meter.setProgress(1);
onComplete();
}
}
private function onComplete():void {
if (_refreshTimer != null) {
_refreshTimer.stop();
_refreshTimer.removeEventListener(TimerEvent.TIMER, onProgress);
_refreshTimer = null;
}
hide();
}
|
Hope this helps! Cheers!