Flex: calling an actioncript function from an htmlText anchor

Is there a way to call the script action function from the binding that is defined in the property of the HTMLAText component of the TextArea component.

thanks

+3
source share
3 answers

I got an answer here ..

+1
source

If this anchor is the href from the tag, you can send events and handle them as follows:

<mx:Script>
    <![CDATA[
        private function linkHandler(e:TextEvent):void
        {
            if (e.text == "test")
                trace("test called")
        }
    ]]>
</mx:Script>
<mx:creationComplete>
    <![CDATA[
        textArea.htmlText="<a href='event:test'>Link!</a>";
    ]]>
</mx:creationComplete>

<mx:TextArea id="textArea" link="linkHandler(event)" />  
+5
source

ExternalInterface Javascript ActionScript. , Javascript, .

AS 3.0. , !

ExternalInterface Docmentation

0
source

Source: https://habr.com/ru/post/1708461/


All Articles