# Comparing XML with variable in AS2

**URL:** <https://forum.kirupa.com/t/comparing-xml-with-variable-in-as2/77699>\
**Category:** Uncategorized\
**Created:** [January 29, 2005, 7:50am UTC](https://forum.kirupa.com/t/comparing-xml-with-variable-in-as2/77699 "2005-01-29T07:50:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tross7](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Tross7](https://forum.kirupa.com/u/Tross7)\
**Post date:** [January 29, 2005, 7:50am UTC](https://forum.kirupa.com/t/comparing-xml-with-variable-in-as2/77699/1 "2005-01-29T07:50:56Z")

</div>

Hi Kirupa’ers,  
I hope you all can help me in this kind of problem

I doing some map tracking which I want to set the coordinates of state1 and state2 as:  
state1\_x = 100;  
state1\_y = 200;  
state2\_x = 200;  
state2\_y = 200;

at this point, my first question is = should i put state1 as an object that contains state1\_x and state1\_y?

OK, then i extract some info from file.xml about the originState and destinationState which originState contains “state1” and destinationState contains “state2”

so the second question is = what should i do to compare the node value ive gotten from the xml which i the return value is “state1xml” with the state1 (in question1)I intended to have in flash?

what i have in mind is in pseudocode as:

compare the state1xml with state1  
set \_root.stateOrigin\_x = state1\_x;  
set \_root.stateOrigin\_y = state1\_y;

Sorry if somehow my explanation confuse you all, post any inquiries regarding my questions.  
Any replies are followed with millions of thanks.

Trossseven
