Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-01-2004, 04:06 PM
Junior Member
 
Join Date: May 2004
Posts: 5
Default setFocus concern

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
Reply With Quote
  #2 (permalink)  
Old 06-02-2004, 08:55 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:setFocus concern

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.
Reply With Quote
  #3 (permalink)  
Old 06-02-2004, 04:01 PM
Junior Member
 
Join Date: May 2004
Posts: 5
Default Re:setFocus concern

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
Reply With Quote
  #4 (permalink)  
Old 06-06-2004, 04:38 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:setFocus concern

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.
Reply With Quote
  #5 (permalink)  
Old 06-09-2004, 10:39 PM
Junior Member
 
Join Date: May 2004
Posts: 5
Default Re:setFocus concern

Cool!

Thanks for your help!

It works well. Have a great day!

Mark
Reply With Quote
  #6 (permalink)  
Old 11-01-2005, 07:44 PM
Junior Member
 
Join Date: Oct 2004
Posts: 8
Default Re:setFocus concern

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?
Reply With Quote
  #7 (permalink)  
Old 11-01-2005, 07:45 PM
Junior Member
 
Join Date: Oct 2004
Posts: 8
Default Re:setFocus concern

Oh I just saw that this thread came with an example. Hurrah!
Reply With Quote
  #8 (permalink)  
Old 01-14-2009, 09:38 PM
Junior Member
 
Join Date: Nov 2008
Posts: 7
Default No focus into the text field

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).
Reply With Quote
  #9 (permalink)  
Old 01-18-2009, 01:02 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

It seems to be strange. Can you send us your file (support@swfkit.com)? Thank you.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:04 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.