Is there a way to set an open and close state for a plugin / graphic ?
See this one for an example: http://wideeyes.dk/temp/krybily/ the menu items can be toggled and have a graphic that changes.
Please provide a sample code on how to achieve this.
Is there a way to set an open and close state for a plugin / graphic ?
See this one for an example: http://wideeyes.dk/temp/krybily/ the menu items can be toggled and have a graphic that changes.
Please provide a sample code on how to achieve this.
Hi,
there are more possibilities to do this:
1. change the onclick function:
example xml - a button to show and hide a infoscreen:
<action name="showinfo">
set(plugin[button].onclick,action(hideinfo));
set(plugin[info].enabled,true);
set(plugin[info].visible,true);
tween(plugin[info].alpha,1.0,distance(1.0,0.2),easeOutQuart);
</action>
<action name="hideinfo">
set(plugin[button].onclick,action(showinfo));
set(plugin[info].enabled,false);
tween(plugin[info].alpha,0.0,distance(1.0,0.2),easeOutQuart,set(plugin[info].visible,false));
</action>
<plugin name="button" ....
onclick="action(showinfo);"
/>
Display More
2. use the new IF function: (1.0.8 beta 4 or higher)
xml example:
<plugin name="button" ... state="closed"
onclick="if( state == closed , action( openaction ), action( closeaction) );"
/>
<action name="openaction">
set(plugin[button].state, opened);
set(plugin[info].visible,true);
</action>
<action name="closeaction">
set(plugin[button].state, closed);
set(plugin[info].visible,false);
</action>
Display More
best regards,
Klaus
This "if" function is very usefull, thank you !
What a truly great piece of software! Unfortunately I'm having a difficult time implementing this IF statement... I can get it to work without the IF - i.e. onclick="action(openaction);" - any suggestions? Great work Klaus!
<plugin name="panel"
url="graphics/panel.png"
zorder="1"
origin="top"
edge="centerbottom"
x="0"
y="45"
alpha="0.99"
scale="1.0"
state="closed"
onclick="if (state == closed, action(openaction), action (closeaction));"
/>
<action name="openaction">
tween(plugin[panel].y,650,0.75);
set(plugin[panel].state, opened);
</action>
<action name="closeaction">
tween(plugin[panel].y,-650,0.75);
set(plugin[panel].state, closed);
</action>
Display More
What a truly great piece of software! Unfortunately I'm having a difficult time implementing this IF statement... I can get it to work without the IF - i.e. onclick="action(openaction);" - any suggestions? Great work Klaus!
Code Display Moreurl="graphics/panel.png" zorder="1" origin="top" edge="centerbottom" x="0" y="45" alpha="0.99" scale="1.0" state="closed" onclick="if (state == closed, action(openaction), action (closeaction));" /> tween(plugin[panel].y,650,0.75); set(plugin[panel].state, opened); tween(plugin[panel].y,-650,0.75); set(plugin[panel].state, closed);
Try this
onclick="if(state == closed, action(openaction), action(closeaction));"
Thanks for the help, it works!
===============
Two things - for those who are trying to figure things out too...
I was negligent in replacing my krpano.swf with the 1.0.8beta5 - so it wouldn't work regardless!
I replaced my old krpano.swf (1.0.7) with the new one (1.0.8Beta5) - still didn't work with original code (mine).
I followed above suggestion and it worked - just had to remove 2 "space" characters in the appropriate spots.
it didn't work with the spaces between?
sorry, I will check this, should be fixed soon
Don’t have an account yet? Register yourself now and be a part of our community!