I have run into a significant problem using the js() action on Internet Explorer 9 (IE9). I have created a <hotspot> with custom properties inside of a <scene>, and then I am using get() to retrieve them for use inside of a js() call. The problem is that only the first get(property) is being parsed properly: instead of passing the property's value, a string is being passed. This is only occurring in IE9 and below from what I can tell. I am testing inside a IE test virtual machine on Mac OS X. An example of the code is below.
The scene xml markup: (the irrelevant markup has been omitted.
<scene name="scene_sceneOne" title="sceneOne" >
<view />
<preview />
<image></image>
<!-- place your scene hotspots here -->
<hotspot name="spot1" ath="0" atv="0" triggertype="type1" triggerid="id"
onclick="js(handleTrigger( get(triggertype),get(triggerid) ));"
/>
</scene>
Corresponding javascript function:
function handleTrigger( type, id ) {
console.log(type +' '+ id);
//switchcase over type, to allow for all js() calls to pass through one handling function
switch ( type ) {
case 'type1' :
//do something if type 1
var dynamicParam = id;
//do something with dynamicParam
break;
default :
return false;
break;
}
}
Alles anzeigen
So, on all other browsers when this hotspot is clicked, "type1 id" will be logged to the console, however on IE9 and below "type1 get(triggerid)" will be logged instead.
I am going to try and figure out a work around that uses only one hotspot property, perhaps holding an object, since it passes the first parameter fine. In the meantime, is there something wrong with the above implementation or is this in fact a bug? Thanks!
[size=10]
[size=10]