To be able to actually use the system focus would be an elegant
solution, I hope you find it.

 

If you don't, you can always store a reference to an actual component in
an instance var, and set / unset that reference using focus and focusOut
event handlers.  Not ideal of course, but there it is.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Teresa Howington
Sent: Friday, March 28, 2008 10:14 AM
To: [email protected]
Subject: [flexcoders] Re: need help capturing focus in a variable or
using event to capture current target

 

I've had my nose buried in 3 Flex books and several forums for 3 days 
now. I've not been able to find documentation showing an example of 
how to use focus. I even put a message in the Adobe LiveDocs, and 
they responded, "question is too specific. look elsewhere."

Has ANYONE ever attempted to catch focus in some manner or form? This 
should not be that hard but this is becoming a real pain!

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> Look into the focus events. I don't know if there's a 
global "focusChanged"
> event or something like that, but you can definitely hook 
into "focusIn" and
> "focusOut" on individual components.
> 
> -J
> 
> On Fri, Mar 28, 2008 at 7:30 AM, Teresa Howington 
<[EMAIL PROTECTED]>
> wrote:
> 
> > Hi everyone,
> >
> > I'm relatively new to Flex, and need help with targeting. I'm 
creating an
> > app that has multiple text areas, shape, and image objects. I 
want the user
> > to be able to click on one of these, have it show that 
it's "selected", and
> > then use the control buttons I make to manipulate the objects, 
like changing
> > font, rotating, etc.
> >
> > I'm using this Flex snippet from
> > http://blog.paranoidferret.com/index.php/2007/08/14/flex-snippet-
<http://blog.paranoidferret.com/index.php/2007/08/14/flex-snippet-> 
tutorial-using-the-textrange-class/
> > but trying to avoid hardcoding the target.
> >
> > Look at this snippet in particular:
> >
> > **************
> >
> > <mx:Script>
> > <![CDATA[
> > import mx.controls.textClasses.TextRange;
> > import mx.events.ColorPickerEvent;
> >
> > private var textSelection:TextRange;
> >
> > private function initTextArea():void
> > {
> > textSelection = new TextRange(txtSlate, true); *<--- see 
how the
> > target "txtSlate" is hardcoded there? I want to refer to some 
generic
> > variable that captures the currently selected target. What method 
should I
> > use?
> > * }
> >
> > private function increaseFontSize():void
> > {
> > textSelection.fontSize++;
> > }
> >
> > ***********************
> >
> > Any help would be appreciated! Thank you!
> >
> > Tess
> > 
> >
> 
> 
> 
> -- 
> "Therefore, send not to know For whom the bell tolls, It tolls for 
thee."
> 
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
>

 

Reply via email to