This works because you are sending in time, after everything that would have automatically reset the focus is finished. Good catch.
Bob On Jul 6, 2011, at 2:56 PM, Slava Paperno wrote: > I love this list for the education I get as much as for the practical > advice. > > After hearing everything that has been said in this thread (mostly by > Jacque, but also by others), here is the solution that works. > > To recap briefly, the problem is what Jacque calls "the engine's > long-standing behavior that automatically focuses on the first object that > has traversalOn set to true whenever the card changes." In my case, I wanted > a field called "SearchTarget" to receive the focus after the user clicks the > Find button, so the user could type another target for the search. I tried > using [focus on field "SearchTarget"] at the end of the mouseUp script of > the Find button, and it did not work: the focus always ended up on the card. > Here is what does work: > > ==== > > This handler is in the field's script: > > on focusOnMe > select after char -1 of me > end focusOnMe > > This is the last line in the script of the Find button: > > send "focusOnMe" to field "SearchTarget" in 100 milliseconds > > ==== > > Thanks, everybody! > > Slava _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode