How to make effect WindowOpen slide effect when pressing a key?
#1
Hi there,

I'm trying to make an animation like this: when I press a key, fire up the WindowOpen animation defined for the whole window.
I tried this to define a conditional animation for the window:
<animation effect="slide" time="300" start="1280,0" condition="Control.HasFocus(500)">Conditional</animation>

Then, I created an invisible button (with Id 500) which get focus when I press the key. I did that with setFocusId(500) somewhere in the code.

However, this doesn't work. Any idea on how to do this?

Thanks
Reply
#2
Did you put the animation at the same place where the WindowOpen animation is? The animation should work, I don't see anything why it shouldn't... did you add allowhiddenfocus = "true" to the button's visible condition?
Image
Reply
#3
I'm not sure what you mean, but I have this at the beginning of my window xml:
<window id="4007">
<animation effect="slide" time="300" start="1280,0" end="0,0" condition="Control.HasFocus(500)">conditional</animation>

Is this ok?

Thanks
Reply
#4
Yes, should be ok. If your control is hidden, you have to add allowhiddenfocus to the button's visible condition, maybe that's your problem:

Code:
<control type="button">
   ...
   <visible allowhiddenfocus="true">...</visible>
</control>

If you added that already, I have no idea why it doesn't work...
Image
Reply
#5
Unfortunately, this still doesn't work...it seems that the control doesn't get immediate focus after setFocusId(). If I do setFocusId(500) and then getFocusId(), the result is other id...A few actions after, then seems ok... But I guess this is not the problem...
Have someone tried this?

Thanks
Reply
#6
We really need your code to test it out.
Reply
#7
I think I understand now...You can only assign WindowOpen or WindowClose animations to Windows. It is not possible to add Conditional or any other type of animations to Windows, only to Controls.
What I did was to create a group with all the controls and put the Conditional animation in the group control. Then it worked! Smile

Thanks
Reply

Logout Mark Read Team Forum Stats Members Help
How to make effect WindowOpen slide effect when pressing a key?0