开发者

Flash AS2: Override TextField Focus Event

开发者 https://www.devze.com 2023-02-04 22:27 出处:网络
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 u

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"); }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号