views:

261

answers:

1

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 advance!

+1  A: 

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...

Richard Inglis