Sie sind nicht angemeldet.

1

Montag, 6. Mai 2013, 10:05

setting and getting variable

Hello,

I'd like to show info picture for each scene.

My idea is set variable Ninfo with the name of info picture in onstart of each scene:
<scene name="scene_02panocorr" title="Hlavní loď - stará část" onstart="activatespot(mapspot2, 270);set(Ninfo,info2.png);closeinfo();"

than under "i" button in controll panel call the action for showing the info picture:
<action name="displayInfo">
set(plugin[infoScreen].visible,true);
set(plugin[close1].visible,true);
set(plugin[info].onclick,closeHelp();)
</action>
and finally in plugin infoScreen get value from variable Ninfo which should be the name of the right picture:
<plugin name="infoScreen" align="center" customColor="true" keep="true" onclick="closeInfo();" url="get(Ninfo);" visible="false" />

but here is some syntax error.

Question is: what is the right syntax for url="get(Ninfo);" instead of url="skin/info2.png" ?

Thank you in advance

2

Dienstag, 7. Mai 2013, 14:32

Hi,

that's not possible - the xml definitions itself (like url="...") are static - it's not possible to get there dynamic values,

the xml loading/parsing and actions work this way:

1. first the xml structure will be loaded and parsed
2. then the viewer will start working
3. and from now on it will be possible to use actions to change any values

you could try it this way:
onstart="activatespot(mapspot2, 270); set(plugin[infoScreen].url,info2.png); closeinfo();"

best regards,
Klaus

3

Mittwoch, 8. Mai 2013, 00:45

Thank you for reply.
I'll try this and let you know.
Marty