Re: [Flashcoders] Capturing TextEvent from image in textfield
Maybe this is what you need to do... You will have to have the not around the image, but you can use the same function to handle the and the click. txt.htmlText = "This is a movieClip inside of a text field Isn't it sweet?"; txt.getImageReference("myMC").addEventListener (MouseEvent.ROLL_OVER, onRollOver); function onRollOver (e:MouseEvent):void { trace("oh Ya"); } Ktu On Wed, Nov 11, 2009 at 12:07 AM, Mattheis, Erik (MIN - WSW) < ematth...@webershandwick.com> wrote: > 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 = ' src="plus" />Our world-class scientists'; > > 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 > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Capturing TextEvent from image in textfield
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 = ' />Our world-class scientists'; > 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
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 = ' />Our world-class scientists'; > 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
Re: [Flashcoders] Capturing TextEvent from image in textfield
Try pageText.displayValue.htmlText = 'src="' + plus + '" />Our world-class scientists'; I think it was reading your URLs as strings of text instead of variables holding the URLs. Not positive though. J.A.T. Karl Sent from losPhone On Nov 10, 2009, at 6: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 = 'src="plus" />Our world-class scientists'; 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] Capturing TextEvent from image in textfield
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 = 'Our world-class scientists'; 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