Hi folks,
At first congratulation to you, Adobe and Flex team for Adobe Flash Builder 4 & flex 4 SDK final release...
then, I have a click attribute in my textFlow anchor tag, just like this:
<fx:Script> <![CDATA[ import mx.controls.Alert; public function func():void{ Alert.show("hello!"); } ]]></fx:Script><s:RichEditableText x="50" y="50" editable="false" id="RET"> <s:TextFlow> <s:a href='http://www.adobe.com' click='func()'> <s:img source='adobe.jpg' width='50' height='50' /> </s:a> </s:TextFlow></s:RichEditableText>
When I run the project, everything's allright; and after click on my image, I have adobe site in new window, and also have my popup alert window with "Hello!" text...
But the Problem is another thing. I want to give this textFlow content from one webservice and put it in a string var then bind it to my RichEditableText. I receive it from webservice, put it in the string, and then bind this string to textFlow attribute of my RichEditableText obj with simple function... after running my project, I can see the content, and when I click on my image, I have adobe site in new window, again. but my function does not call!
What is the problem?! the code is something like this (of course without webservice codes!):
<fx:Script> <![CDATA[ import flashx.textLayout.conversion.TextConverter; import mx.controls.Alert; public function func():void{ Alert.show("hello!"); } internal var str:String; public function func2():void{ str = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008' paddingRight='5'>"+ "<a href='http://www.adobe.com' click='func();'><img source='adobe.jpg' width='50' height='50' /></a>"+ "</TextFlow>"; RET.textFlow= TextConverter.importToFlow(str, TextConverter.TEXT_LAYOUT_FORMAT); } ]]></fx:Script><s:RichEditableText x="50" y="50" editable="false" id="RET" />