Hi,
set() and get() are 'sync'but call() just puts the given commands into a queue and execution of the commands in this queue is 'async' and depends on the other currently running commands
That means in your case the trace calls are executed when the value of 'g' already has the value 200.
Thx for replying.
I got it,
that's why the variable "gx" always return the same value.
But how can i do to get a different value?
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
|
for (var i = 0; i < 3; i++) {
var point = krpano.get("hotspot[" + i + "]");
krpano.call("spheretoscreen(point.ath,point.atv,gx,gy);");
var gx = krpano.get("gx");
var gy = krpano.get("gy");
var p = {
"x" : gx,
"y" : gy
};
hotspotpoint.push(p);
}
|