开发者

actionscript 2.0:Check TextField in flash

I have some problem in check two textfield.text comparison. One TextField.text value is come from calculation and the other textField is from user input. When I check those two text, the TextField.text value didn't show and I can't compare those two. How can I compare in actionscript 2.0. Please Help me! Thanks in开发者_如何学C advance!


If the textFields are set up correctly, what you've done should be ok.

Here's an example of how it should work:

//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
}

Now run this and try typing in the inputText field...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜