Skip to main content
Jhon Carlo
Inspiring
March 1, 2015
Question

Compare two word

  • March 1, 2015
  • 1 reply
  • 665 views

I need to compare two word in two different text.

I use the "if" condition, for exemple:

  if (MytextA == MytextB)

  {

  trace("==");

  }

else

{

  trace("!=");

}

But I suppose == and !== is a wrong method for text and my purpose.

Can you help me?

Thank you.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
March 1, 2015

If MytextA and MytextB are the names of the two textfields, you need to test their text properties...

  if (MytextA.text == MytextB.text)

Jhon Carlo
Inspiring
March 1, 2015

Thank you Ned,

of course! I write it in my post a short form,

but also " if (MytextA.text == MytextB.text)" doesn't work.

Thank you again.

Ned Murphy
Legend
March 1, 2015

It should.  Explain what you have done on the stage for what you call MytextA and MytextB