Re: [Flashcoders] Link text indexes in a TextField

2010-08-31 Thread Karim Beyrouti

I have textfield link detection in this class - 


https://code.google.com/p/kurstcode/source/browse/trunk/libs/com/kurst/utils/TextFieldUtils.as

using it for link roll-over / roll-out events. And I think it could be extended 
to get the link's start/end position.
Have a look at the 'detectMouseOver' function - could be a good starting 
point...

- karim

On 30 Aug 2010, at 19:47, Andrew Murphy wrote:

 Hello. :)
 
 Thank you, but I think that will give me the link's text from within the
 htmlText property of the TextField.
 
 
 What I need are the beginning and ending indexes of the link within the
 text property of the TextField.  That is, after the HTML has been rendered
 into the displayed text.
 
 I've thought of finding the index of the TextEvent's text property (ie:
 block1) within the htmlText property of the TextField and using that to
 determine the indexes, but those indexes would be relative to the
 TextField's htmlText property, rather than it's text property.
 
 
 
 --
 Andrew Murphy
 Interactive Media Developer
 amur...@delvinia.com
 
 Delvinia
 370 King Street West, 5th Floor, Box 4 
 Toronto Canada M5V 1J9
 P (416) 364-1455 ext. 232
 F (416) 364-9830  
 W www.delvinia.com
 
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nathan
 Mynarcik
 Sent: August 30, 2010 14:35 pm
 To: Flash Coders List
 Subject: Re: [Flashcoders] Link text indexes in a TextField
 
 You will have to cull out what you want:
 
 **Psuedo Code**
 
 var stuff:String = [a href=event:block1]dolor sit[/a];
 
 stuff.substr(stuff.indexOf([a href=event:block1]),
 stuff.indexOf([/a]));
 
 
 
 Nathan Mynarcik
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com
 
 
 On Mon, Aug 30, 2010 at 1:46 PM, Andrew Murphy amur...@delvinia.com wrote:
 
 Hi. :)
 
 Does anyone know of a way to get the beginning and ending index of a link
 within a TextField?
 
 I want the indexes of the beginning and ending of the text that makes up
 the
 link.  For example if I pass the following HTML text into the TextField:
 
 
   [p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]
 
 
 What I want is the beginning and ending indexes of the dolor sit text
 when
 the user clicks on it.  The TextEvent.LINK event passes out the value of
 the
 href within the link text (ie: block1), which isn't terribly useful in
 this case.
 
 
 
 ( ps:  I used square brackets in the example HTML text rather than angle
 brackets to try avoiding issues with the list's mailer, which doesn't like
 HTML code in emails. )
 
 
 --
 Andrew Murphy
 Interactive Media Developer
 amur...@delvinia.com
 
 Delvinia
 370 King Street West, 5th Floor, Box 4
 Toronto Canada M5V 1J9
 P (416) 364-1455 ext. 232
 F (416) 364-9830
 W www.delvinia.com
 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Link text indexes in a TextField

2010-08-31 Thread Andrew Murphy
Good morning.

I came up with a solution, it's not elegant but it works:


1) Break up the HTML into an array of chunks of code based on where the
links occour.  So this:

 [p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]

Gets turned into this:

 blocks[0] = [p]Lorem ipsum 
 blocks[0] = [a href=event:block1]dolor sit[/a]
 blocks[0] =  amet.[/p]

2) Go through that array of chunks, concatenating each chunk with the chunks
before it and plugging the results into the TextField.  Force it to render
(validateNow();) each time and use the previous and current length of the
text property to determine the beginning and ending indices of each chunk.

3) For any chunks containing a link, save the link's URL and indices into an
array.  ie:

 link_props[0] = {name:block1, begin:12, end:21}

4) When a link is clicked use the text property of the TextEvent.LINK
event to get at the indices for that link in the array.


Thank you for helping. :)


 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Link text indexes in a TextField

2010-08-31 Thread Andrew Murphy
Thank you, but I came up with a solution. :)

 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karim
Beyrouti
Sent: August 31, 2010 05:37 am
To: Flash Coders List
Subject: Re: [Flashcoders] Link text indexes in a TextField


I have textfield link detection in this class - 


https://code.google.com/p/kurstcode/source/browse/trunk/libs/com/kurst/utils
/TextFieldUtils.as

using it for link roll-over / roll-out events. And I think it could be
extended to get the link's start/end position.
Have a look at the 'detectMouseOver' function - could be a good starting
point...

- karim

On 30 Aug 2010, at 19:47, Andrew Murphy wrote:

 Hello. :)
 
 Thank you, but I think that will give me the link's text from within the
 htmlText property of the TextField.
 
 
 What I need are the beginning and ending indexes of the link within the
 text property of the TextField.  That is, after the HTML has been
rendered
 into the displayed text.
 
 I've thought of finding the index of the TextEvent's text property (ie:
 block1) within the htmlText property of the TextField and using that
to
 determine the indexes, but those indexes would be relative to the
 TextField's htmlText property, rather than it's text property.
 
 
 
 --
 Andrew Murphy
 Interactive Media Developer
 amur...@delvinia.com
 
 Delvinia
 370 King Street West, 5th Floor, Box 4 
 Toronto Canada M5V 1J9
 P (416) 364-1455 ext. 232
 F (416) 364-9830  
 W www.delvinia.com
 
 
 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nathan
 Mynarcik
 Sent: August 30, 2010 14:35 pm
 To: Flash Coders List
 Subject: Re: [Flashcoders] Link text indexes in a TextField
 
 You will have to cull out what you want:
 
 **Psuedo Code**
 
 var stuff:String = [a href=event:block1]dolor sit[/a];
 
 stuff.substr(stuff.indexOf([a href=event:block1]),
 stuff.indexOf([/a]));
 
 
 
 Nathan Mynarcik
 nat...@mynarcik.com
 254.749.2525
 www.mynarcik.com
 
 
 On Mon, Aug 30, 2010 at 1:46 PM, Andrew Murphy amur...@delvinia.com
wrote:
 
 Hi. :)
 
 Does anyone know of a way to get the beginning and ending index of a link
 within a TextField?
 
 I want the indexes of the beginning and ending of the text that makes up
 the
 link.  For example if I pass the following HTML text into the TextField:
 
 
   [p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]
 
 
 What I want is the beginning and ending indexes of the dolor sit text
 when
 the user clicks on it.  The TextEvent.LINK event passes out the value of
 the
 href within the link text (ie: block1), which isn't terribly useful
in
 this case.
 
 
 
 ( ps:  I used square brackets in the example HTML text rather than angle
 brackets to try avoiding issues with the list's mailer, which doesn't
like
 HTML code in emails. )
 
 
 --
 Andrew Murphy
 Interactive Media Developer
 amur...@delvinia.com
 
 Delvinia
 370 King Street West, 5th Floor, Box 4
 Toronto Canada M5V 1J9
 P (416) 364-1455 ext. 232
 F (416) 364-9830
 W www.delvinia.com
 
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Link text indexes in a TextField

2010-08-31 Thread Ktu
so whats your solution?

On Tue, Aug 31, 2010 at 9:42 AM, Andrew Murphy amur...@delvinia.com wrote:

 Thank you, but I came up with a solution. :)

  --
 Andrew Murphy
 Interactive Media Developer
 amur...@delvinia.com

 Delvinia
 370 King Street West, 5th Floor, Box 4
 Toronto Canada M5V 1J9
 P (416) 364-1455 ext. 232
 F (416) 364-9830
 W www.delvinia.com


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karim
 Beyrouti
 Sent: August 31, 2010 05:37 am
 To: Flash Coders List
 Subject: Re: [Flashcoders] Link text indexes in a TextField


 I have textfield link detection in this class -



 https://code.google.com/p/kurstcode/source/browse/trunk/libs/com/kurst/utils
 /TextFieldUtils.as

 using it for link roll-over / roll-out events. And I think it could be
 extended to get the link's start/end position.
 Have a look at the 'detectMouseOver' function - could be a good starting
 point...

 - karim

 On 30 Aug 2010, at 19:47, Andrew Murphy wrote:

  Hello. :)
 
  Thank you, but I think that will give me the link's text from within the
  htmlText property of the TextField.
 
 
  What I need are the beginning and ending indexes of the link within the
  text property of the TextField.  That is, after the HTML has been
 rendered
  into the displayed text.
 
  I've thought of finding the index of the TextEvent's text property (ie:
  block1) within the htmlText property of the TextField and using that
 to
  determine the indexes, but those indexes would be relative to the
  TextField's htmlText property, rather than it's text property.
 
 
 
  --
  Andrew Murphy
  Interactive Media Developer
  amur...@delvinia.com
 
  Delvinia
  370 King Street West, 5th Floor, Box 4
  Toronto Canada M5V 1J9
  P (416) 364-1455 ext. 232
  F (416) 364-9830
  W www.delvinia.com
 
 
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com
  [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nathan
  Mynarcik
  Sent: August 30, 2010 14:35 pm
  To: Flash Coders List
  Subject: Re: [Flashcoders] Link text indexes in a TextField
 
  You will have to cull out what you want:
 
  **Psuedo Code**
 
  var stuff:String = [a href=event:block1]dolor sit[/a];
 
  stuff.substr(stuff.indexOf([a href=event:block1]),
  stuff.indexOf([/a]));
 
 
 
  Nathan Mynarcik
  nat...@mynarcik.com
  254.749.2525
  www.mynarcik.com
 
 
  On Mon, Aug 30, 2010 at 1:46 PM, Andrew Murphy amur...@delvinia.com
 wrote:
 
  Hi. :)
 
  Does anyone know of a way to get the beginning and ending index of a
 link
  within a TextField?
 
  I want the indexes of the beginning and ending of the text that makes up
  the
  link.  For example if I pass the following HTML text into the TextField:
 
 
[p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]
 
 
  What I want is the beginning and ending indexes of the dolor sit text
  when
  the user clicks on it.  The TextEvent.LINK event passes out the value of
  the
  href within the link text (ie: block1), which isn't terribly useful
 in
  this case.
 
 
 
  ( ps:  I used square brackets in the example HTML text rather than angle
  brackets to try avoiding issues with the list's mailer, which doesn't
 like
  HTML code in emails. )
 
 
  --
  Andrew Murphy
  Interactive Media Developer
  amur...@delvinia.com
 
  Delvinia
  370 King Street West, 5th Floor, Box 4
  Toronto Canada M5V 1J9
  P (416) 364-1455 ext. 232
  F (416) 364-9830
  W www.delvinia.com
 
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
Ktu;

The information contained in this message may be privileged and/or
confidential. If you are NOT the intended recipient, please notify the
sender immediately and destroy this message.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Link text indexes in a TextField

2010-08-31 Thread Andrew Murphy
I already posted my solution to this list. :)

 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Ktu
Sent: August 31, 2010 10:15 am
To: Flash Coders List
Subject: Re: [Flashcoders] Link text indexes in a TextField

so whats your solution?

On Tue, Aug 31, 2010 at 9:42 AM, Andrew Murphy amur...@delvinia.com wrote:

 Thank you, but I came up with a solution. :)

  --
 Andrew Murphy
 Interactive Media Developer
 amur...@delvinia.com

 Delvinia
 370 King Street West, 5th Floor, Box 4
 Toronto Canada M5V 1J9
 P (416) 364-1455 ext. 232
 F (416) 364-9830
 W www.delvinia.com


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karim
 Beyrouti
 Sent: August 31, 2010 05:37 am
 To: Flash Coders List
 Subject: Re: [Flashcoders] Link text indexes in a TextField


 I have textfield link detection in this class -




https://code.google.com/p/kurstcode/source/browse/trunk/libs/com/kurst/utils
 /TextFieldUtils.as

 using it for link roll-over / roll-out events. And I think it could be
 extended to get the link's start/end position.
 Have a look at the 'detectMouseOver' function - could be a good starting
 point...

 - karim

 On 30 Aug 2010, at 19:47, Andrew Murphy wrote:

  Hello. :)
 
  Thank you, but I think that will give me the link's text from within the
  htmlText property of the TextField.
 
 
  What I need are the beginning and ending indexes of the link within the
  text property of the TextField.  That is, after the HTML has been
 rendered
  into the displayed text.
 
  I've thought of finding the index of the TextEvent's text property
(ie:
  block1) within the htmlText property of the TextField and using that
 to
  determine the indexes, but those indexes would be relative to the
  TextField's htmlText property, rather than it's text property.
 
 
 
  --
  Andrew Murphy
  Interactive Media Developer
  amur...@delvinia.com
 
  Delvinia
  370 King Street West, 5th Floor, Box 4
  Toronto Canada M5V 1J9
  P (416) 364-1455 ext. 232
  F (416) 364-9830
  W www.delvinia.com
 
 
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com
  [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nathan
  Mynarcik
  Sent: August 30, 2010 14:35 pm
  To: Flash Coders List
  Subject: Re: [Flashcoders] Link text indexes in a TextField
 
  You will have to cull out what you want:
 
  **Psuedo Code**
 
  var stuff:String = [a href=event:block1]dolor sit[/a];
 
  stuff.substr(stuff.indexOf([a href=event:block1]),
  stuff.indexOf([/a]));
 
 
 
  Nathan Mynarcik
  nat...@mynarcik.com
  254.749.2525
  www.mynarcik.com
 
 
  On Mon, Aug 30, 2010 at 1:46 PM, Andrew Murphy amur...@delvinia.com
 wrote:
 
  Hi. :)
 
  Does anyone know of a way to get the beginning and ending index of a
 link
  within a TextField?
 
  I want the indexes of the beginning and ending of the text that makes
up
  the
  link.  For example if I pass the following HTML text into the
TextField:
 
 
[p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]
 
 
  What I want is the beginning and ending indexes of the dolor sit text
  when
  the user clicks on it.  The TextEvent.LINK event passes out the value
of
  the
  href within the link text (ie: block1), which isn't terribly useful
 in
  this case.
 
 
 
  ( ps:  I used square brackets in the example HTML text rather than
angle
  brackets to try avoiding issues with the list's mailer, which doesn't
 like
  HTML code in emails. )
 
 
  --
  Andrew Murphy
  Interactive Media Developer
  amur...@delvinia.com
 
  Delvinia
  370 King Street West, 5th Floor, Box 4
  Toronto Canada M5V 1J9
  P (416) 364-1455 ext. 232
  F (416) 364-9830
  W www.delvinia.com
 
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo

Re: [Flashcoders] Link text indexes in a TextField

2010-08-30 Thread Henrik Andersson

Andrew Murphy skriver:

Hi. :)

Does anyone know of a way to get the beginning and ending index of a link
within a TextField?

I want the indexes of the beginning and ending of the text that makes up the
link.  For example if I pass the following HTML text into the TextField:


 [p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]


What I want is the beginning and ending indexes of the dolor sit text when
the user clicks on it.  The TextEvent.LINK event passes out the value of the
href within the link text (ie: block1), which isn't terribly useful in
this case.


Are you sure that you need the positions? The flash.text.engine package 
has this nifty thing called mirror regions, perhaps they are useful here?


Or perhaps you just need multiple content elements?

It is hard to help when you don't know the purpose.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Link text indexes in a TextField

2010-08-30 Thread Mattheis, Erik (MIN-WSW)
This might give you some ideas on accomplishing what you needs to do -use 
split().join():

http://troyworks.com/blog/2008/03/14/flash-textfield-actionscript-hyperlink-in-as30/



_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Andrew Murphy
Sent: Monday, August 30, 2010 12:47 PM
To: 'Flash Coders List'
Subject: [Flashcoders] Link text indexes in a TextField

Hi. :)

Does anyone know of a way to get the beginning and ending index of a link
within a TextField?

I want the indexes of the beginning and ending of the text that makes up the
link.  For example if I pass the following HTML text into the TextField:


[p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]


What I want is the beginning and ending indexes of the dolor sit text when
the user clicks on it.  The TextEvent.LINK event passes out the value of the
href within the link text (ie: block1), which isn't terribly useful in
this case.



( ps:  I used square brackets in the example HTML text rather than angle
brackets to try avoiding issues with the list's mailer, which doesn't like
HTML code in emails. )


 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Link text indexes in a TextField

2010-08-30 Thread Nathan Mynarcik
You will have to cull out what you want:

**Psuedo Code**

var stuff:String = [a href=event:block1]dolor sit[/a];

stuff.substr(stuff.indexOf([a href=event:block1]), stuff.indexOf([/a]));



Nathan Mynarcik
nat...@mynarcik.com
254.749.2525
www.mynarcik.com


On Mon, Aug 30, 2010 at 1:46 PM, Andrew Murphy amur...@delvinia.com wrote:

 Hi. :)

 Does anyone know of a way to get the beginning and ending index of a link
 within a TextField?

 I want the indexes of the beginning and ending of the text that makes up
 the
 link.  For example if I pass the following HTML text into the TextField:


[p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]


 What I want is the beginning and ending indexes of the dolor sit text
 when
 the user clicks on it.  The TextEvent.LINK event passes out the value of
 the
 href within the link text (ie: block1), which isn't terribly useful in
 this case.



 ( ps:  I used square brackets in the example HTML text rather than angle
 brackets to try avoiding issues with the list's mailer, which doesn't like
 HTML code in emails. )


  --
 Andrew Murphy
 Interactive Media Developer
 amur...@delvinia.com

 Delvinia
 370 King Street West, 5th Floor, Box 4
 Toronto Canada M5V 1J9
 P (416) 364-1455 ext. 232
 F (416) 364-9830
 W www.delvinia.com


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Link text indexes in a TextField

2010-08-30 Thread Andrew Murphy
Hello. :)

Thank you, but this script doesn't appear to return the beginning and ending
indexes of the link.



 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Mattheis,
Erik (MIN-WSW)
Sent: August 30, 2010 14:23 pm
To: Flash Coders List
Subject: RE: [Flashcoders] Link text indexes in a TextField

This might give you some ideas on accomplishing what you needs to do -use
split().join():

http://troyworks.com/blog/2008/03/14/flash-textfield-actionscript-hyperlink-
in-as30/



_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Andrew
Murphy
Sent: Monday, August 30, 2010 12:47 PM
To: 'Flash Coders List'
Subject: [Flashcoders] Link text indexes in a TextField

Hi. :)

Does anyone know of a way to get the beginning and ending index of a link
within a TextField?

I want the indexes of the beginning and ending of the text that makes up the
link.  For example if I pass the following HTML text into the TextField:


[p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]


What I want is the beginning and ending indexes of the dolor sit text when
the user clicks on it.  The TextEvent.LINK event passes out the value of the
href within the link text (ie: block1), which isn't terribly useful in
this case.



( ps:  I used square brackets in the example HTML text rather than angle
brackets to try avoiding issues with the list's mailer, which doesn't like
HTML code in emails. )


 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Link text indexes in a TextField

2010-08-30 Thread Andrew Murphy
Hi. :)

Mirror regions sound like they might do the job, but I'm limited to working
with the v9 plug-in.  (Sorry.. I should have mentioned that in my first
email.)

I'm not certain what you mean by using multiple content elements.

The effect I'm looking for is that when the user clicks on a link the Flash
draws a highlight around the link's text and passes the beginning and ending
indexes of that text to another function.  I really do need the beginning
and ending indexes.



 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik
Andersson
Sent: August 30, 2010 14:15 pm
To: Flash Coders List
Subject: Re: [Flashcoders] Link text indexes in a TextField

Andrew Murphy skriver:
 Hi. :)

 Does anyone know of a way to get the beginning and ending index of a link
 within a TextField?

 I want the indexes of the beginning and ending of the text that makes up
the
 link.  For example if I pass the following HTML text into the TextField:


  [p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]


 What I want is the beginning and ending indexes of the dolor sit text
when
 the user clicks on it.  The TextEvent.LINK event passes out the value of
the
 href within the link text (ie: block1), which isn't terribly useful in
 this case.

Are you sure that you need the positions? The flash.text.engine package 
has this nifty thing called mirror regions, perhaps they are useful here?

Or perhaps you just need multiple content elements?

It is hard to help when you don't know the purpose.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Link text indexes in a TextField

2010-08-30 Thread Andrew Murphy
Hello. :)

Thank you, but I think that will give me the link's text from within the
htmlText property of the TextField.


What I need are the beginning and ending indexes of the link within the
text property of the TextField.  That is, after the HTML has been rendered
into the displayed text.

I've thought of finding the index of the TextEvent's text property (ie:
block1) within the htmlText property of the TextField and using that to
determine the indexes, but those indexes would be relative to the
TextField's htmlText property, rather than it's text property.



 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nathan
Mynarcik
Sent: August 30, 2010 14:35 pm
To: Flash Coders List
Subject: Re: [Flashcoders] Link text indexes in a TextField

You will have to cull out what you want:

**Psuedo Code**

var stuff:String = [a href=event:block1]dolor sit[/a];

stuff.substr(stuff.indexOf([a href=event:block1]),
stuff.indexOf([/a]));



Nathan Mynarcik
nat...@mynarcik.com
254.749.2525
www.mynarcik.com


On Mon, Aug 30, 2010 at 1:46 PM, Andrew Murphy amur...@delvinia.com wrote:

 Hi. :)

 Does anyone know of a way to get the beginning and ending index of a link
 within a TextField?

 I want the indexes of the beginning and ending of the text that makes up
 the
 link.  For example if I pass the following HTML text into the TextField:


[p]Lorem ipsum [a href=event:block1]dolor sit[/a] amet.[/p]


 What I want is the beginning and ending indexes of the dolor sit text
 when
 the user clicks on it.  The TextEvent.LINK event passes out the value of
 the
 href within the link text (ie: block1), which isn't terribly useful in
 this case.



 ( ps:  I used square brackets in the example HTML text rather than angle
 brackets to try avoiding issues with the list's mailer, which doesn't like
 HTML code in emails. )


  --
 Andrew Murphy
 Interactive Media Developer
 amur...@delvinia.com

 Delvinia
 370 King Street West, 5th Floor, Box 4
 Toronto Canada M5V 1J9
 P (416) 364-1455 ext. 232
 F (416) 364-9830
 W www.delvinia.com


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders