rctplcs
rctplcs

Reputation: 341

Flash syntax problem

Quick question.

Trying to get error clip to play if email is not good, trying

if (trace(emailExpression.test(email.text))) 
{
    error_email.play();
}

but it's playing even if email is right. any thoughts? I think its something with syntax!

Upvotes: 0

Views: 29

Answers (1)

Marty
Marty

Reputation: 39466

trace() returns void whereas for an if() statement to function as expected you want to parse a value that equates either to true of false.

Maybe try ditching the trace() and see if that works - I'm not sure what test() does so I can't be certain.

if(emailExpression.test(email.text)) 
{
    error_email.play();
}

Upvotes: 1

Related Questions