making dynamic text clickable

I'm loading external data (text) into a TextArea and now I want to make parts of that text clickable. What is the best way to make text in a TextArea trigger an action, specifically a call to setMedia()? Is there a way for HTML anchor tags to trigger events within a Flash file? Or some other approach?

This is for a playlist that goes with a custom video player. The playlist TextArea will be in the same .swf file as the video player component.
LVL 6
merwetta1Asked:
Who is Participating?
 
blue-genieCommented:
Hi, i'm not sure what version of flash you're using, but there's the good ol asFunction that always works a charm for me...

from help files...

function MyFunc(arg){ //replace with your setMedia() method
  trace ("You clicked me! Argument was "+arg);
}
myTextField.htmlText ="<A HREF=\"asfunction:MyFunc,Foo \">Click Me!</A>";

how are you loading ur text, using LoadVars? simply swap out the text above into your txt file.
should do the trick.
0
 
merwetta1Author Commented:
asfunction is what I was looking for. thanks.

I want to display the dynamic data in a TextArea so the scrollbars will be handled for me. However, a TextArea component makes its embedded TextField a child of the current timeline. I figured out that if you want to use the asfunction protocol in a TextArea, you need to add "_parent." to the function name...

myTextArea.text ='<A HREF="asfunction:_parent.MyFunc,Foo">Click Me!</A>';
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.