fross
03-02-2007, 04:33 PM
Hi all,
I have a question on how to do something that I hoped was simple, but is getting complicated, so I thought maybe I'm doing something wrong.
I want to have a TextField, that when clicked on, pops up a window (a Sprite containing more TextFields, basically) that gives the user more options. And when the user clicks outside of this popup area, it disappears.
I can get it almost working as such quite easily - I can get the popup appearing, and the links working, and clicking on the original text removes the popup. Almost perfect.
But it's this capturing the "any click outside the box" (but inside the movie obviously) that is proving difficult. I tried doing stage.addEventListener for MouseEvent.CLICK when opening the popup, but that just triggers immediately. Plus, I'm not sure whether it would be the best thing, it might override the link in the popup I do want to work?
This should be something pretty basic to do (I am in pure AS3, so no nice Flex stuff to do it for me!), but I'm sure someone has done this already, so any hints you can give would be very welcome.
Thanks, and hope you all have a good weekend.
I have a question on how to do something that I hoped was simple, but is getting complicated, so I thought maybe I'm doing something wrong.
I want to have a TextField, that when clicked on, pops up a window (a Sprite containing more TextFields, basically) that gives the user more options. And when the user clicks outside of this popup area, it disappears.
I can get it almost working as such quite easily - I can get the popup appearing, and the links working, and clicking on the original text removes the popup. Almost perfect.
But it's this capturing the "any click outside the box" (but inside the movie obviously) that is proving difficult. I tried doing stage.addEventListener for MouseEvent.CLICK when opening the popup, but that just triggers immediately. Plus, I'm not sure whether it would be the best thing, it might override the link in the popup I do want to work?
This should be something pretty basic to do (I am in pure AS3, so no nice Flex stuff to do it for me!), but I'm sure someone has done this already, so any hints you can give would be very welcome.
Thanks, and hope you all have a good weekend.