|
|||
|
Using SWFKit Express 2.1 r2
Making a standalone projector packed with multiple SWFs. In the first, loaded swf are input text fields, one in which I would like to have the focus on without any user interaction. I searched the forums and found out that this issue was fixed in the new release. My question is, how do I go about making it " setFocus " on the input field of choice? My swfs work fine outside of SWFKit, so I know I am missing something within SWFKit. The entire projector works fine if I click on the screen once. Mark |
|
|||
|
In preview mode(by pressing F9), it cannot set the focus. But the output exe file can set focus properly.
When you inactivate the app and then activate it again, the focus will be lost. The sample shows how to always keep the focus in the text field. |
|
|||
|
Excellent. Works perfectly.
Now, can I ask some details as to how this works? - the getMainWnd().onMessage has me a bit confused. Where do you get the "msg" that you pass for the "if" check? And what does the whole "if msg ==" line do? I guess I am lost on the details of that line. - you set a 50 millisec interval; why that amount? Is that important? - I removed the FlashPlayer.targetCallLabel line. It works, but is it better codeing to have a targetCallLabel in my flash for the SWFKit to work properly? Thanks again for your help! Have a great day! Mark |
|
|||
|
The onMessage event handler is used to handle the WM_ACTIVATE message of the main window. When the main window is activated or disactivated, it receives the message.
When the window is activated, the onMessage function sets the focus into the text field. It doesn't call the setFocus function directly for the default message handler of the main window will change the focus in the main window after calling the onMessage function. That is to say, we must call the setFocus function after the return of the default WM_ACTIVATE message handler. The "setInterval" method can do this. You can change the value "50" to any other values, but you may want the app to call the setFocus method asap. The "targetCallLabel" method calls the frame in the movie to set the focus into the text field. If you remove it the text field cannot get focus automatically when the main window is activated again. |
|
|||
|
I have this problem as well and am now confused as to what to do. I have three buttons. They tab through fine when I first open my application. But if I click out of it and then click back again they do not get focus. What did you do to fix this?
|
|
|||
|
Where can I find the example for this thread?
I've made three inputboxes in the main Flashmovie for registering my app. In Flash only it works fine (can type input), but in SFWkit I get no focus (see only a textcursor but no characters when I type something). |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|