Enter key disabled

DLL Edition of the F-IN-BOX
ozmatt
Posts: 4
Joined: Wed Mar 15, 2006 1:18 am

Enter key disabled

Postby ozmatt » Wed Mar 15, 2006 1:28 am

Hi,

Well done, I think this product is excellent so far.

Has the Enter key been disabled somehow?

I have a TextField in which I want Flash to respond to the Enter key being pressed. I have added code to the TextField prototype to listen for the Enter key and it works in Flash (Version 8), and using the standard Flash projector, but when I run my FlashPlayerControl version it doesn't respond to the Enter key.

My code:

TextField.prototype.onKeyDown = function () {
if (Key.getCode() == Key.ENTER
&& this.pressedOnce == undefined
&& this.isFocused()) {
this.onSubmit();
this.pressedOnce = true;
}
};

TextField.prototype.onKeyUp = function () {
if (Key.getCode() == Key.ENTER) {
this.pressedOnce = undefined;
}
};

mc_Search2.txtSearch.onSubmit = function() {mc_Search2.DoSearch(0);}
Key.addListener(mc_Search2.txtSearch);


Thanks and regards,
Matt

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Wed Mar 15, 2006 9:53 am

Thank you for your question.

If you use MFC and flashplayercontrol is a child window of a dialog you can solve the task by overriding PreTranslateMessage:

Code: Select all

BOOL CMFCTestAppDlg::PreTranslateMessage(MSG* pMsg)
{
   if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
      return FALSE;

   return CDialog::PreTranslateMessage(pMsg);
}
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

ozmatt
Posts: 4
Joined: Wed Mar 15, 2006 1:18 am

Postby ozmatt » Wed Mar 15, 2006 1:01 pm

Thankyou. I'm not using MFC, I'm using ATL. Do you know of an equivalent?
Matt

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Wed Mar 15, 2006 1:29 pm

FlashPlayerControl window is a child window of a dialog window? And when ENTER is pressed the dialog closes? Or dialog doesn't close and FlashPlayerControl just doesn't respond to ENTER?
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

ozmatt
Posts: 4
Joined: Wed Mar 15, 2006 1:18 am

Postby ozmatt » Wed Mar 15, 2006 1:47 pm

FlashPlayerControl window is a child window of a dialog window. When ENTER is pressed nothing happens. But if I run the movie within Flash I have a function which executes in response to the ENTER key. Basically I have a "search" function using a TextField for the search text. I want the search results to display when the ENTER key is pressed. I don't want the user to be forced to use the mouse. This works in my movie when run in Flash but not when run in my FlashPlayerControl app.

Basically the TextField.prototype.onKeyDown function gets executed within Flash (when the ENTER key is pressed) but not within FlashPlayerControl.
Matt

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Wed Mar 15, 2006 2:05 pm

Please download last demo version of the dll and test your application again. If the problem is still exists, could you send me your project with the flash movie to support (at) flashplayercontrol.com ?
Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

ozmatt
Posts: 4
Joined: Wed Mar 15, 2006 1:18 am

Postby ozmatt » Fri Mar 17, 2006 9:54 am

Working now! Thanks a lot for your excellent support.

(downloaded latest dll, still had same problem, sent project to softanics support who promptly replied with a fix to my ATL C++ code)
Matt

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Fri Mar 17, 2006 10:29 am

The solution is replacing a modal dialog by a modeless dialog.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 14 guests

cron