【问题标题】:actionscript 2.0:Check TextField in flashactionscript 2.0:检查 Flash 中的 TextField
【发布时间】:2010-04-02 14:51:18
【问题描述】:

我在检查两个 textfield.text 比较时遇到了一些问题。一个 TextField.text 值来自计算,另一个 textField 来自用户输入。当我检查这两个文本时, TextField.text 值没有显示,我无法比较这两个。如何在 actionscript 2.0 中进行比较。请帮我!提前致谢!

【问题讨论】:

    标签: comparison actionscript-2 textfield


    【解决方案1】:

    如果 textFields 设置正确,你所做的应该没问题。

    以下是它应该如何工作的示例:

    //with the text tool, make two textFields on the stage
    //In the Properties window, set the instance name of one to 'dynamicText'
    //and set it's text type to be Dynamic Text
    //Set the other one to be named 'inputText'
    //and make it of text type Input Text
    //enter some dummy text in each field to start with
    
    dynamicText.text="pAssw0rd" //for example
    
    inputText.onChanged= function() {
    trace("match is "+(dynamicText.text == inputText.text));//true or false
    }
    

    现在运行它并尝试在 inputText 字段中输入...

    【讨论】:

      猜你喜欢
      • 2014-05-10
      • 1970-01-01
      • 1970-01-01
      • 2013-11-21
      • 1970-01-01
      • 1970-01-01
      • 2014-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多