Skip to main content
Participating Frequently
June 14, 2006
Question

Can part of text in Textarea invoke actionscript?

  • June 14, 2006
  • 2 replies
  • 261 views
Is is possible to make text inside of a Textarea component actuall close the Textarea itself? I have been using a Textarea component to dynamically add a bunch of formatted text into it, based on an object that was clicked. Initially, this Textarea does not show up, but when clicking the other object, it shows up with the necessary information. However, I now have no way to close/hide this.

I added some text at the top right of the Textarea that says "Close", and I would like the user to be able to click on this to close/hide the Textarea "window". How can I do this? Are there other ways besides what I am trying to do? All I really want to be able to do is call the following piece of code:

myTextarea.visible = false;

Ideally, if this can be done, I would like the cursor to change to the hand, so it is obvious to the user that this is in fact clickable.

I am getting pretty desparate, so any help would be greatly appreciated!
This topic has been closed for replies.

2 replies

woodtahAuthor
Participating Frequently
June 20, 2006
No thoughts from anyone ?
Inspiring
June 20, 2006
Put the text area in a movieclip and use the _visible property of the movieclip.
woodtahAuthor
Participating Frequently
June 15, 2006
I did some digging in some old test code I had and I stumbled across the snippet shown below. This would make the Textarea disappear when any part of it was clicked. However, I found 2 problems with this approach:

  • If you tried to use the scrollbars, the Textarea disappeared
  • This did not work when publishing for Flash 7 (it worked when I published to Flash 6)

    I am using some stylesheet stuff, so I need to be able to publish to Flash 7 (I am using Flash MX2004 Pro). Also, I still want the users to be able to scroll, if needed.

    So now it appears I am back where I started -- it would be ideal if I could click something in the Textarea that would end up closing the Textarea.

    Any suggestions?