-
You could use onSetFocus to update a variable with the 'lastFocused'.
This could then be used in your button code.
<Mike>
Andreas Rønning wrote:
...which is, i gather, somewhat of a general consensus.
I'm working on a tablet pc application that requires the user to be able
to select text and transfer this text to other parts of the application.
The ideal way is as such:
1. The user makes a selection from *any selectable text field*
2. A button appears near the selected text
3. The user taps the button
4. The selected text is copied to a buffer
5. The selection is cleared
6. An event is broadcast
Now my problem is, this is what happens:
1. The user makes a selection
2. A button appears near the selected text
3. The user taps the button
4. The text field loses focus, launching Selection.onSetFocus, which
checks if the current selection, now "null", is an editable textfield.
Naturally,
null is not, so the button becomes hidden.
5. The user releases the now invisible button
6. Selection.onSetFocus gathers that the new selection is "null", and
uh, returns focus to the text field, which retains its selection.
7. Now that the textfield, which is "valid" in terms of this purpose,
the button is shown again.
Hmm.. Infinite cycle. Not cool.
The big issue here is that Selection.onSetFocus is called prior to
MovieClip.onPress. This basically means there's no way i can make
changes to the current selection
before onSetFocus is called. With this in mind: How the bloody hell is
it possible to make changes to a selection with a button?
The more i kick this horse around, the more contrived the AS looks, and
it's becoming seriously demoralizing.
Any input is appreciated.
- A
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
-------------------------------------
Mike Cobb
Creative Director
HMC Interactive
-------------------------------------
Tel: + 44 (0)845 20 11 462
Mob: + 44 (0)785 52 54 743
Web: http://www.hmcinteractive.co.uk
-------------------------------------
Grosvenor House, Belgrave Lane,
Plymouth, PL4 7DA, UK.
-------------------------------------
I've got a new e-mail address: [EMAIL PROTECTED]
Please update your address book. Thanks.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com