Move in/out a panel

i have this question,

i want to move in/out a panel when clicked,

the logic i could derive is using the effect move with mode in and mode out, but i cant figure it out, how to implement it, with onClick = “abc()”, as it will call a function in java abc(), and that function should set the effect to move in, and/or move out if already moved in!

just a little syntax is what m looking for!

You can manually start effects from java. You will need to use a custom effect for this and then you’ll need to get the Nifty Element that has the effect attached to onCustom with something like: Element e = screen.findElementByName(). When you have the Element you can call e.startEffect(EffectEventId.onCustom) to start the effect.

This forum should have example code for this hidden somewhere. And I think in the wiki this is explained as well. If all else fails you can take a look at the nifty-examples project and search for “onCustom” in the XML-Examples there. Starting effects from Java is used a couple of times in the examples already.