You can accomplish this in Flex 2 by using the TextEvent class:
http://livedocs.macromedia.com/flex/2/langref/flash/events/TextEvent.html
 
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:
http://livedocs.macromedia.com/flex/2/langref/migration.html
 
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