That's because as soon as you hit the button, there is no focus on any Input Textfield :-) but the focus is on the button instead.
Try that action in an onClipEvent(enterframe) attached to a movieclip.
onClipEvent(enterframe){ str=selection.getfocus(); }
to see the selected textfields name, place a dynamic textfield in the MC the action is attached to, and name it 'str'.
here's something I did a while back: http://www.flashingdutchman.com/libraries/actionscripts/selection.html http://www.flashingdutchman.com/libraries/actionscripts/selection.zip
Muzak
----- Original Message ----- From: "System Administrator" <cjaeger@visualfood.ch> To: "flasher from chinwag" <flasher@lists.chinwag.com> Sent: Wednesday, May 09, 2001 1:48 PM Subject: [flasher] Selection Object
> Hi, > > Anyone in luck with Selection.getFocus(); ? > This should just return a string with my textfiled/variable path right? > All I'm getting is null even if I have text selected in the respectable > field. > Just for fun here's the code: > > on (press) { > str = Selection.getFocus(); > } > > I'm on a Mac and getting paranoid. > > Cheers for any help > > Cornelius > www.visualfood.ch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Chinwag site carries a wealth of Flash resources. Find useful links, suggested reading and archives at:
** http://www.chinwag.com/flasher ** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You are subscribed to flasher as: flash@tallylist.com To unsubscribe, email leave-flasher-479872H@lists.chinwag.com