PDA

View Full Version : Checking for 2 conditions at once


Conlor
05-17-2008, 11:53 PM
sorry for all the questions people, but I am working to get a project done by Wensday, and this is my last issue. Anyways, I know that for an "if" statement, you can perform two things at once by doing this (note that I know these aren't the right terms, I just don't know what else to call them):

on("some sort of event"){
if("condition") {
"function 1";"function 2";}}

My question: is it possible to check for two "conditions" at once to perform one "fuction"? I tried to use a semi-colon in the condition brackets, but it didn't work...again, sorry for the stupid questions, but I'm running out of time for this...

Conlor
05-18-2008, 12:12 AM
never mind, I figure it out: it was the && function. Sorry for wasting your time, people.

hockeyb47
05-18-2008, 12:16 AM
Yes, you can.

if (someCondition && someOtherCondition || thisOtherOneIsCool)
trace("success");