Nevermind. Just listening for a link event on a mx:Text component works fine even though there is no listed link event for an mx.control.Text object. I would imagine the reason for this is that the event bubbles from the internal textField.

Hank

On 10/11/06, hank williams <[EMAIL PROTECTED]> wrote:
I tried this but I am not sure how to use a TextField in flex. I cant add a TextField to a UIComponent because UIComponent.addChild expects a UIComponent as a parameter. How can I integrate these.

Hank

On 10/11/06, hank williams <[EMAIL PROTECTED]> wrote:
Thanks a lot! Just what I needed.

Regards,
Hank


On 10/11/06, Prakaz < [EMAIL PROTECTED]> wrote:
You can accomplish this in Flex 2 by using the TextEvent class:
 
from livedocs:
import flash.text.TextField;
import flash.events.TextEvent;  

var tf:TextField = new TextField();
tf.htmlText = "<a href=''>Click Me.</a>";
tf.addEventListener("link", clickHandler);
addChild(tf);

function clickHandler(e:TextEvent):void {
  trace(e.type); // link
  trace(e.text); // myEvent
}


pass the function name you want to call to the link Event, in this case its clickHandler.

This was accomplished in the previous version of AS using asfunction.
differences between ActionScript 2.0 and 3.0:
 
Hope that helps,
 
P
 
 
On 10/11/06, hank williams < [EMAIL PROTECTED]> wrote:

I want to have a block of text that executes a function when the user
clicks the hyperlink. Could someone give me an example or point me to
the proper formatting.

Thanks
Hank





__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to