# FLEX: Problem with htmlText calling AS events

**URL:** <https://forum.kirupa.com/t/flex-problem-with-htmltext-calling-as-events/255242>\
**Category:** Uncategorized\
**Created:** [March 20, 2008, 11:38am UTC](https://forum.kirupa.com/t/flex-problem-with-htmltext-calling-as-events/255242 "2008-03-20T11:38:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [March 20, 2008, 11:38am UTC](https://forum.kirupa.com/t/flex-problem-with-htmltext-calling-as-events/255242/1 "2008-03-20T11:38:51Z")

</div>

Hi,

I have a very bizarre issue with flex. I have created an htmlText that has a link in it. The link is:  
\<a href=“asfunction:unpausePlayback”\>Continue »\</a\>  
I have also tried:  
\<a href=“event:unpausePlayback”\>Continue »\</a\>

On the creation function of the text object i add a listener:

```auto

_text.addEventListener(TextEvent.LINK, unpausePlayback);
	if (_text.hasEventListener(TextEvent.LINK) != true){
		Alert.info("Hmm");
	}

```

The event never gets called. However if i change it to “== true” so that the alert gets called then it works fine. Even if i add a totally unrelated alert before or after the listener then the listener works, but without an alert (which i really can’t have in the final version) the listener just never works.

I have no idea why and it is driving me nuts! Any ideas?

Thanks
