PDA

View Full Version : Double click on a dynamic/input text field component


maxx
10-23-2007, 11:43 PM
Hello. I've run a search through these forums - apologies if I've missed an answer somewhere - but everything that comes up under "double click" or "doubleClick" or "onDoubleClick" seems to be with regards to a button or movieclip object. I've got some text fields (GhostWire InputField component instances) and some combobox (also Ghostwire components) that I need to be able to track a double click event to handle. I can't seem to get it to work on either.

If I use the setInstance() tracking method usually recommended to compare the time between clicks, it's got to run off the .onRelease() or onPress() events, which then overrides the edit-ability of the text fields. I've tried nesting a "trigger" movieclip within another movieclip also containing the InputField, but if the trigger is on top, it kills the editing capabilities of the InputField (understandably) and if it's beneath the InputField, it does nothing.

Is there a way to allow a user to click once on the dynamic/input text field to enable editing of the field and its' contents, but twice to trigger a totally different event handler (in this case, and attachMovie() handler)?

I'll admit it's been a long day, so please, if the info is there and you can remember where it is, feel free to just point me to it and I'll take it from there. But I'm starting to pull out hair by the roots.

Scott Euser
10-24-2007, 12:13 AM
you could dynamically make a "hit area" type thing...

function notdoubleclick(){
if (firstclick==0){
//trigger your "enable editing of the field and its contents" here
} else {
firstclick=0;
}
clearInterval(doubleclicked);
}
firstclick=0;
onmousedown{ //or onmouseup here... not sure
if (_ymouse>my_txt._x && _ymouse<my_txt._x+my_txt._width && etc...){
if (firstclick==1){
firstclick=0;
//trigger your "totally different" event handle here
}else {
firstclick=1;
}
doubleclicked=setInterval(notdoubleclick,250);
}
}