闪存输入掩码 (AS3)
有谁知道如何实现 Flash 文本字段的输入掩码? (AS3)
Does anybody know how to implement input masks for flash textfields? (AS3)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有谁知道如何实现 Flash 文本字段的输入掩码? (AS3)
Does anybody know how to implement input masks for flash textfields? (AS3)
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
查看 TextField 限制 属性
不作为作为真正的输入掩码很迷人,但可以完成限制输入的工作
Check out the TextField restrict property
Not as glamorous as a true input mask, but gets the job done on restricting input
Flash 的 TextField 类不支持输入掩码(但 flex TextInput 类支持)。
您可能需要做的是创建一个正则表达式 进行验证
您可以监听 TextField 的 Event.CHANGE 并运行一些代码,尝试将字符串与正则表达式进行匹配。 如果匹配则有效,如果不匹配则以某种方式通知用户。
Flash's TextField class doesn't support input masks (the flex TextInput class does however).
What you probably need to do is create a regular expression to validate against
You could listen to the Event.CHANGE of the TextField and run some code that trys to match the string against your regular expression. If it matches it's valid, if it doesn't you notify the user somehow.