I believed this code by Zephyr could help, but somehow it returns some error:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<krpano>
<events onxmlcomplete="parsedate()" />
<action name="parsedate">
js(get_date());
if(get(day) == '24',
if(get(month) == '02',
if(get(year) == '2011',
trace('Jeej, today is 24-02-2011');
);
);
);
</action>
</krpano>
|
html:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
function get_date()
{
var krpanoObj = document.getElementById('krpanoSWFObject');
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
krpanoObj.set('day', day);
krpanoObj.set('month', month);
krpanoObj.set('year', year);
}
|
Sorry Im a bit rusty with xml if statements, so mind the typos. But you get the idea :)
Here is the original post:
http://krpano.com/forum/wbb/index.php?pa…24185#post24185
I wanted to alter this code for my purposes, but first I wanted to try how it works. ANd this is what I get:
Warning: js() - calling Javascript "get date()" failed: Error: TypeError: krpano.set is not a function
Any help? Are there any typos?