Thanks for responding, James! Your workaround indeed works very nicely--as you say, so long as the autotab of all editable members is false, or there's only one editable member on the stage.

I test with Dir 10.1 under Windows XP SP2.

Isn't it odd that something as simple as changing the eidtable property of a text member requires a workaround with a dummy sprite? The property has been in Director forever... But with your tremendous experience behind this advice, I am at least satisfied that I'm not missing something obvious...

In case Tom is listening, or some future reader looks this up, the problem is this:

My purpose is to remove the distraction of the blinking insertion cursor in a text input box on the stage. I was hoping to achieve this by making the text member non-editable until the user clicks in it. When the user is done editing the text, I want the text box to be uneditable again and to show no blinking insertion cursor. For example, this is how you may want a Search input box to behave. (The Search input field in the Firefox browser does this.)

I could not achieve this by setting the text member's editable property on and off. My scripts are shown in the original post below. James Newton's workaround is also shown below.

Slava

At 05:10 AM 12/5/2005, you wrote:
"Slava Paperno" <[EMAIL PROTECTED]> wrote
A text member (an Input box) is attached to this sprite, named InputBox:

on beginSprite me
  sprite(me.SpriteNum).member.editable  = false
end

on mouseDown me
  sprite(me.SpriteNum).member.editable  = true
end

A "Done" button on the stage does this:

on mouseUp
   sprite("InputBox").member.editable = false
end

I want the input box to be non-editable until the user clicks it. After the user inputs his text, I want him to click the Done button so the input box becomes non-editable. When the user clicks the input box, I want the text member to be editable again.

What actually happens in my test movie is that when I first click the input box, it behaves as expected: the insertion point appears, and the box becomes editable. I click Done, and the insertion cursor disappears, as expected. But when I click the input box again, the insertion point does not reappear, even though the text becomes editable.

Hi Slava,

My experience is slightly different. When testing with DMX04 on Windows XP2, in the Object Inspector, I can see that the text member is editable and that the keyboardFocusSprite is set to the sprite that contains it... but no keyboard input appears in the member. It takes a second click on the sprite to make the text insertion point appear and to make the member accept input. It may be that making a text member editable has different consequences in different environments.

Is this the only editable text member on the Stage? If so, one solution would be to avoid changing the editable of the member. Instead, when you click on the Done button you transfer the keyboardFocus to a different editable sprite off-stage:

-- Done button
on mouseUp
 the keyboardFocusSprite = sprite("Off-stage editable").spriteNum
end

This means that the user can no longer type into the on-stage text member. If the member in the off-stage sprite has its .autotab property set to FALSE, the only way the user can start typing into the on-stage text member again is to click on it.

If you have a number of editable on-stage members whose .autotab property you want to keep as TRUE, then you might find that this workaround becomes very complex. In this case, the user could use the Tab key to return to the member that you want to force him to click on. You would have to override the autotab feature so that you can manually skip returning to the 'non-editable' sprite.

Does this help?

James


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to