Flash AS2: Override TextField Focus Event
Is it possible to override the default focus event on the in-built TextField class? So for example when a textfield gains focus a custom event is triggered rather than the default one? I know we can use the onSetFocus event, however we have over 1200 swfs that use TextFields so want to do it on a global scope rather than having t开发者_运维技巧o modify each individual swf.
The idea is that on an Android tablet selecting a TextField brings up the android keyboard that not only shrinks the flash content, but defaults to the alpha keyboard when all we want is numeric (it's a Maths app).
You can't override the event, but you can extend the TextField class by setting the onSetFocus method on its prototype object:
TextField.prototype.onSetFocus = function () { trace ("onSetFocus"); }
精彩评论