AS Q.
- Started
- Last post
- 20 Responses
- emecks
been ages since I did any Flash.
how do I check if a value lies between two extremes?
if(x>5 && x < 100) ??
is this the only way?
I seem to remember there was a shorthand way of doing it...
- emecks0
nobody?
- skt0
why not just use that?
- emecks0
cos apart from having to check
that x lies between 5 and 100 I need to check that y lies between 6 and 60 too....that would either mean hunners of &&s or nested if statements, no?
- skt0
sorry mx, if there is shorthand, i dinnae ken it.
where is maximillion?
- emecks0
was jsut asking masel the same question when ah read your answer, ken?
:p
- Milan0
That's the only way I know of doing it.
- NONEIS0
if (((x > 5) and (x
- skt0
fail. and it looks like you were just typing out what he already had.
- emecks0
yer no wrong skt.
I've posted to the flashcoders list, if I get the answer I'll post it here too :)
- mikotondria20
couldnt you just write a function, taking the number, and the 2 extremes and return true if it's between them ?
- emecks0
suppose so miko.. basically I need to check the _xmouse and _ymouse are within an area before drawing into a mask, so a function that takes _xmouse and _ymouse as arguments and returns a boolean could work :)
- skt0
it would still have the same logic, but it would be tidier.
- wordsinmouth0
yeah i would check it through a function, much tidier
- skt0
i think we had that one worked out brendan. he was looking for shorthand.
amateur
- emecks0
cheers _maximillion, I did kind of have that, as his sktness pointed out, but cheers all the same :)
- maximillion_0
sorry to disapoint
cuntybaws
- maximillion_0
the shorthand way is somthing like :
- maximillion_0
and yr func
- emecks0
and now ye ARE Billy Big Baws.
cheers ya cunt.