[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

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.
1 Solution
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.
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>';

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now