Karl, Gerry -

Thanks, I just tried the code I posted below at home and it works as expected.

I must have done something funky elsewhere in the code with the version at 
work: when I click on "Our world-class scientists," the event fires, when I 
click on the movieclip in the textfield it doesn't.

In the problematic version, I'm altering the externally loaded text at runtime, 
inserting an image in places that need a visual indicator for "this text 
expands". I'm guessing the way I'm doing it doesn't add the event listener to 
the movieclip because it's not yet been added to the display list.
________________________________________
From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gerry 
[noentour...@gmail.com]
Sent: Tuesday, November 10, 2009 8:57 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Capturing TextEvent from image in textfield

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html#event:link


On Nov 10, 2009, at 7:47 PM, Mattheis, Erik (MIN - WSW) wrote:

> How do I send an event from a click on an image in a textfield? Clicking on 
> the actual text fires the event, but it doesn't fire when clicking on an 
> image from the library placed inline:
>
> pageText.displayValue.htmlText = '<p><a href="event:a1"><b><img src="plus" 
> />Our world-class scientists</b></a></p>';
> pageText.displayValue.addEventListener(TextEvent.LINK, toggleVisibility);
>
> function toggleVisibility(e:Event) {
> trace('text event triggered');
> }
>
> Thanks!
> _______________________________________________
> 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

Reply via email to