all groups > flash actionscript > may 2004 >
You're in the

flash actionscript

group:

onPressOutside? how to respond to loss of focus


onPressOutside? how to respond to loss of focus sneakyimp
5/2/2004 11:40:48 PM
flash actionscript:
i am creating a variant of the combobox for selecting a font that displays your
various font options in the actual font.

it's like the built-in combo box that comes with flash...click the little
arrow and your items appear...more than about 8 and you get scroll pane. i do
this by assigning an action to the onPress event of my little arrow...it does
an attachMovie to create a scroll pane called 'spFonts'.

the problem i'm having is how to make the drop down menu (spFonts) disappear
when the user clicks outside my object...whether they choose some entirely
different object or whether they click on the movie background or what. i
can't assign a function to EVERY POSSIBLE CLICKABLE OBJECT to unload spFonts.
there is no onPressOutside event...and i haven't had much luck finding any
functions dealing with focus. can anyone recommend an approach?
Re: onPressOutside? how to respond to loss of focus sneakyimp
5/2/2004 11:55:36 PM
for instance, i put a movie on my stage. in the first frame of the movie, i
have this code:

this.focusEnabled = true;
this.onSetFocus = function() {
trace('selector active');
}

when i click on the object, nothing happens.

AddThis Social Bookmark Button