Tuesday, April 21, 2009

Flash - Create text link in AS3

HTML text fields no longer support "asfunction:" links. Instead they support "event:" links, which will generate a TextEvent.


myTextField.htmlText = "<a href="event:text">test</a>";
myTextField.addEventListener(TextEvent.LINK, handleLink);

function handleLink(evt:TextEvent):void {
trace(evt.text);
}

1 comment:

Anonymous said...

cheers