Checking a number is within a range or ranges

Hi all,

I’ve got a quick question on the most efficient way of checking if a given number lies within a range or ranges of possible values.

I am loading an xml document which contains this snippet:

<y-axis>
<zone start=“1055” finish=“2055”/>
<zone start=“2110” finish=“10000”/>
</y-axis>

There could be anything up to 5 zones. I basically need to check if a value of a number falls within any of these zones, the value is valid if it does, invalid if it doesn’t. Eventually this will be a user interface where a rectangular shape can be drawn and it kind of ‘snaps’ to the closest valid value on both the x and y axis.

So as I say, the first question is what is the most efficient way in AS3 of extracting whether or not a given value is within the safe-zones in the xml? Has anyone got any bright ideas?

Many thanks
Kevin