Is it just me, or is flash not capable of setting focus to a blank field?
If I try and set focus to a field with a value of "" then focus reports as being set, but there is no cursor and I'm unable to type in the field. However, if the field has a value of at least one character then it works fine.
WTF?
JERKSTORE 2009.06.26, 07:14PM — setFocus woes (AS2)
Storm 2009.06.26, 08:24PM —
What Flash Player version are you testing in?
Is it "" as in empty text field on the stage or "" as in an empty String var that has been assigned to the text field
tf.text = emptyString;
?
JERKSTORE 2009.06.26, 09:22PM —
I'm using 10,0,12,36 (Mac)
mcText.onSetFocus = Delegate.create (this, textFieldSetFocus);
private function textFieldSetFocus():Void{
mcText.text = "";
};
So my text field (created with AS) has a default value, and when the field gets focus, I want to clear out the default value.
But if I set it to be an empty String, then there is no cursor and no way to engage the field.
However, if I set it to be ANYTHING but an empty field (mcText.text = "a"; ), it works fine, but then the field isn't empty and ready for input (which is the whole point).
Storm 2009.06.26, 09:31PM —
try:
var es:String;
mcText.onSetFocus = Delegate.create (this, textFieldSetFocus);
private function textFieldSetFocus():Void{
mcText.text = es;
};
or
var es:String;
mcText.onSetFocus = Delegate.create (this, textFieldSetFocus);
private function textFieldSetFocus():Void{
mcText.text = es.toString();
};
and see what happens.
I've never used Delegate and it has been deprecated, so I am also wondering if it's a problem in the newest players.
...no idea really on that.
JERKSTORE 2009.06.26, 09:49PM —
Nope, neither of those worked 
I wouldn't really use Delegate by choice, but it seems to be the only way to do foo.onWhatever = function(){} in a class in AS2 and have it work.
I appreciate the help. Thanks Storm 
Storm 2009.06.26, 10:14PM —
same result right?
I just did this with AS3 but I'll think about it some more and see if anything else pops in my head tonight for AS2.
first