var btn:Button;
if(btn != null && btn.label != '') {
mx.controls.Alert.show("d");
}
In the above if clause, is it guaranteed that the first condition(btn != null) will
be evaluated before the second condition?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes – ActionScript performs appropriate short-circuiting for the
&&operator:So not only will it evaluate the expressions in the order you described, it won’t bother evaluating the second expression at all if the first one returns
false(which is as important a detail as the order of evaluation).Just as a note, ActionScript also supports short-circuiting the logical or operator (
||).