Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2010-05-29 Thread Alex Harui
In theory, the TextLines are parented by the RichEditableText which is a child 
of TextArea.  The TextLine API uses the term “Atom” instead of “character” 
because it can theoretically have images and other non-character things taking 
up space in the line.  I’m not sure TextFlowComposer will help you unless you 
need to re-compose the TextFlow because you changed it enough.

Things like strikethrough are done by drawing directly in the TextLine.  If I 
were to do quick-and-dirty highlighting, I would start by applying child shapes 
and blendmodes.


On 5/29/10 1:01 PM, "Baz"  wrote:






Alex, thanks a lot for the tip, TextLine is VERY interesting and I've been 
researching it a lot. I'm surprised not to have bumped into a plug-and-play 
HighlightComponent that someone's released, so I guess I'll have to roll my 
own. I'm not sure exactly where to start though. Do I use "atoms"? How do I get 
at a RichEditableText's TextLines, it sems only available in TextArea? Should I 
use "TextFlowComposer"?

What would the general anatomy of a "HighlightComponenet" look like?

Thanks!



On Fri, May 28, 2010 at 11:04 AM, Baz  wrote:
Alex I'm going to look into that, thanks for the tip.

Similarly, if I wanted to change the font color of a single word, would I use 
TextLine (or something similar) or would I then have to manually break apart 
the  tags to be able to give them different styles?






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2010-05-29 Thread Baz
Alex, thanks a lot for the tip, TextLine is VERY interesting and I've been
researching it a lot. I'm surprised not to have bumped into a plug-and-play
HighlightComponent that someone's released, so I guess I'll have to roll my
own. I'm not sure exactly where to start though. Do I use "atoms"? How do I
get at a RichEditableText's TextLines, it sems only available in TextArea?
Should I use "TextFlowComposer"?

What would the general anatomy of a "HighlightComponenet" look like?

Thanks!



On Fri, May 28, 2010 at 11:04 AM, Baz  wrote:

> Alex I'm going to look into that, thanks for the tip.
>
> Similarly, if I wanted to change the font color of a single word, would I
> use TextLine (or something similar) or would I then have to manually break
> apart the  tags to be able to give them different styles?
>


Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2010-05-28 Thread Baz
Alex I'm going to look into that, thanks for the tip.

Similarly, if I wanted to change the font color of a single word, would I
use TextLine (or something similar) or would I then have to manually break
apart the  tags to be able to give them different styles?


Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2010-05-27 Thread Alex Harui
Highlights are just graphics drawn into the TextLines.  The TextLines should be 
children of the RichEditableText and you can use TextLine APIs to find 
atom/character positions.


On 5/27/10 6:48 PM, "Baz"  wrote:






Now that some time's gone by, what is the best way in Flex 4 to get the 
coordinates of a specific character? I would like to highlight keywords in a 
RichEditableText component - very much like this example: 
http://flexdevtips.blogspot.com/2010/05/highlight-scrollbar-track.html (view 
source enabled)

Another way would be to dynamical create 's with their own "highlight" 
style when you encounter a keyword.

What's a nice clean Flex 4 way to highlight words in a text?





--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2010-05-27 Thread Baz
Now that some time's gone by, what is the best way in Flex 4 to get the
coordinates of a specific character? I would like to highlight keywords in a
RichEditableText component - very much like this example:
http://flexdevtips.blogspot.com/2010/05/highlight-scrollbar-track.html (view
source enabled)

Another way would be to dynamical create 's with their own
"highlight" style when you encounter a keyword.

What's a nice clean Flex 4 way to highlight words in a text?


Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2009-08-31 Thread cholid cholid
can any body know how to get x, y position of chart?

--- On Mon, 8/31/09, Ian Thomas  wrote:

From: Ian Thomas 
Subject: Re: [flexcoders] How to get X, Y position/coordinates of a specific  
character/letter in a text field
To: flexcoders@yahoogroups.com
Date: Monday, August 31, 2009, 8:35 PM






 





  The mx.controls. TextInput component has the .textField 
property that I

mentioned in my second email.



Are you using spark.components. TextInput instead? In which case I

don't know, I'm afraid - haven't delved that deep into Spark yet.



Sorry!



Ian



On Mon, Aug 31, 2009 at 9:29 PM, Baz wrote:

>

>

> Hey Thanks Ian,

>

> I was just looking at that actually but TextInput doesn't seem to have it

> (Flex 4). I read that you can use:

>

> import mx.core.mx_internal ;

> use namespace mx_internal;

>

> to access TextField and then getCharBoundaries( ) but that doesn't seem to

> work in Flex 4.

>

> Any ideas?

>

> Thanks,

> Baz

>

>

>

> On Mon, Aug 31, 2009 at 1:19 PM, Ian Thomas  wrote:

>>

>>

>>

>> Take a look at flash.text.TextFiel d.getCharBoundar ies() (and other

>> TextField methods).

>>

>> HTH,

>> Ian

>>

>> On Mon, Aug 31, 2009 at 8:53 PM, Baz wrote:

>> >

>> >

>> > Anyone know how to get the X/Y coordinates of a specific

>> > character/letter in

>> > a text field or text input?

>> >

>> > Thanks!

>> >

>> >

>

> 


 

  




 

















  

Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2009-08-31 Thread Ian Thomas
The mx.controls.TextInput component has the .textField property that I
mentioned in my second email.

Are you using spark.components.TextInput instead? In which case I
don't know, I'm afraid - haven't delved that deep into Spark yet.

Sorry!

Ian

On Mon, Aug 31, 2009 at 9:29 PM, Baz wrote:
>
>
> Hey Thanks Ian,
>
> I was just looking at that actually but TextInput doesn't seem to have it
> (Flex 4). I read that you can use:
>
> import mx.core.mx_internal;
> use namespace mx_internal;
>
> to access TextField and then getCharBoundaries() but that doesn't seem to
> work in Flex 4.
>
> Any ideas?
>
> Thanks,
> Baz
>
>
>
> On Mon, Aug 31, 2009 at 1:19 PM, Ian Thomas  wrote:
>>
>>
>>
>> Take a look at flash.text.TextField.getCharBoundaries() (and other
>> TextField methods).
>>
>> HTH,
>> Ian
>>
>> On Mon, Aug 31, 2009 at 8:53 PM, Baz wrote:
>> >
>> >
>> > Anyone know how to get the X/Y coordinates of a specific
>> > character/letter in
>> > a text field or text input?
>> >
>> > Thanks!
>> >
>> >
>
> 


Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2009-08-31 Thread Baz
Hey Thanks Ian,

I was just looking at that actually but TextInput doesn't seem to have it
(Flex 4). I read that you can use:

import mx.core.mx_internal;
use namespace mx_internal;

to access TextField and then getCharBoundaries() but that doesn't seem to
work in Flex 4.

Any ideas?

Thanks,
Baz



On Mon, Aug 31, 2009 at 1:19 PM, Ian Thomas  wrote:

>
>
> Take a look at flash.text.TextField.getCharBoundaries() (and other
> TextField methods).
>
> HTH,
> Ian
>
>
> On Mon, Aug 31, 2009 at 8:53 PM, 
> Baz>
> wrote:
> >
> >
> > Anyone know how to get the X/Y coordinates of a specific character/letter
> in
> > a text field or text input?
> >
> > Thanks!
> >
> >
>  
>


Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2009-08-31 Thread Ian Thomas
Oh - sorry, should have said - you'll need to get at the .textField
property of (for example) your mx.controls.Text object, which will
give you back the raw flash.text.TextField for you to then call
getCharBoundaries() on it.

Unfortunately, .textField is a protected property of mx.controls.Text,
so can't be seen from outside the class.

The simplest way to get at it is to extend mx.controls.Text - build
your own component that inherits from Text. That will give you access
to the .textField property you need; then you can call methods on it
as appropriate.

HTH,
   Ian

On Mon, Aug 31, 2009 at 9:19 PM, Ian Thomas wrote:
> Take a look at flash.text.TextField.getCharBoundaries() (and other
> TextField methods).
>
> HTH,
>   Ian
>
> On Mon, Aug 31, 2009 at 8:53 PM, Baz wrote:
>>
>>
>> Anyone know how to get the X/Y coordinates of a specific character/letter in
>> a text field or text input?
>>
>> Thanks!
>>
>> 
>


Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2009-08-31 Thread Ian Thomas
Take a look at flash.text.TextField.getCharBoundaries() (and other
TextField methods).

HTH,
   Ian

On Mon, Aug 31, 2009 at 8:53 PM, Baz wrote:
>
>
> Anyone know how to get the X/Y coordinates of a specific character/letter in
> a text field or text input?
>
> Thanks!
>
> 


[flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field

2009-08-31 Thread Baz
Anyone know how to get the X/Y coordinates of a specific character/letter in
a text field or text input?

Thanks!