I’m trying to call an as3 function from a dynamic textfield.
I’ve tried this:
function showPopupWindow(){
trace("it works");
}
var texts="Hello world. <a href='#' onclick='showPopupWindow()'><u>This is a function call</u></a>";
text_txt.htmlText = texts;
You’ll have to use the
TextEvent.LINKevent. First, you’ll need to create a link that points to a URL Flash can recognize by prependingevent:to a name. For example, you might have a piece of text like this:Then, you need to add a listener for the event. You can use the
TextEvent::textproperty to determine what link was clicked. Using the above code, here’s a sample handler: