PDA

View Full Version : TextEvent.LINK doesn't want to work under these circumstances...



Stickeroo
January 28th, 2010, 12:37 PM
This is driving me nuts!

I have a symbol on the stage and under a mask at design time. During the course of events, I add another movieclip to the masked clip already on the stage.

This newly-added clip contains yet another clip which contains, among other things, my textfield.

So the hierarchy looks like this:

Stage > Masked clip > Clip > Clip with textfield

That textfield's (named 'tf') htmlText property has a standard link, something like <a href="event:http://www.url.com">Click here</a>

After assigning the htmlText, I add the event listener:



tf.addEventListener(TextEvent.LINK, onTextEvent);

function onTextEvent (evt:TextEvent):void
{
trace (evt.text);
}
However, the link itself doesn't even switch to a hand cursor when the mouse is over it, so forget even hoping the even listener will fire!

If I add the clip directly to the stage, it "works," but adding it there isn't an option. As far as I know, I've ensured that all clips along the way have mouseChildren set to true: I just can't think of why it wouldn't be working as-is. I created a simple test in a new file, and that appeared to work...uggh!

If anyone has any TextEvent input, I'd love to hear it. FYI, I searched before posting this, but nothing I read made much of a difference...Thanks in advance for any help...

creatify
January 28th, 2010, 01:00 PM
It sounds to me that one clip, that isn't visible, is still covering your textField? Can you try to all your clips - including your mask, to mouseEnabled=false; except for the textField - that might narrow down where the problem is - hope this helps.

Stickeroo
January 28th, 2010, 01:42 PM
It sounds to me that one clip, that isn't visible, is still covering your textField? Can you try to all your clips - including your mask, to mouseEnabled=false; except for the textField - that might narrow down where the problem is - hope this helps.

Aha!!! Thank you! You were right: there was an additional invisible mc stealing all my mouse events! I'd repeatedly overlooked it...your post jogged my memory, and after setting that mc's mouseEnabled to false, my textFields can now receive TextEvents! So thanks! :)