Question
Setting Random Positon(X,Y) of a object through XML
Hi , Guys
I am facing a problem : problem is that i have a xml file through which i am getting the value of an object name , path , X , Y position and set it on the screen . But the requirement is that every time when page is loaded position of the object should be changed . Like if the position of an object A is X=20 and Y=30 , first time on load of the page , then second time when page is loaded the position of the object A s hould be different or changed like X=40 , Y=50; This is the problem , i have a XMl file given below through wich i get the value of X, Y of an object.
So please suggest me what I have to do ?
Either i have to change in XMl file or have any script for random position of X, y after getting that value from XMl????
Please Help me out.
<?xml version="1.0" encoding="utf-8"?>
<items>
<item id="1" nme="object1" path="images/a.png" price="250" xpos="20" ypos="300"/>
<item id="2" nme="object1" path="images/b.png" price="320" xpos="80" ypos="300"/>
<item id="3" nme="object1" path="images/c.png" price="190" xpos="140" ypos="300"/>
<item id="4" nme="object1" path="images/d.png" price="120" xpos="200" ypos="300"/>
<item id="5" nme="object1" path="images/e.png" price="110" xpos="260" ypos="300"/>
<item id="6" nme="object1" path="images/a.png" price="900" xpos="320" ypos="300"/>
<item id="7" nme="object1" path="images/c.png" price="250" xpos="380" ypos="300"/>
<item id="8" nme="object1" path="images/d.png" price="310" xpos="440" ypos="300"/>
<item id="9" nme="object1" path="images/e.png" price="190" xpos="500" ypos="300"/>
<item id="10" nme="object1" path="images/c.png" price="120" xpos="560" ypos="300"/>
<item id="11" nme="object1" path="images/e.png" price="110" xpos="620" ypos="300"/>
<item id="12" nme="object1" path="images/a.png" price="900" xpos="680" ypos="300"/>
</items>
I am facing a problem : problem is that i have a xml file through which i am getting the value of an object name , path , X , Y position and set it on the screen . But the requirement is that every time when page is loaded position of the object should be changed . Like if the position of an object A is X=20 and Y=30 , first time on load of the page , then second time when page is loaded the position of the object A s hould be different or changed like X=40 , Y=50; This is the problem , i have a XMl file given below through wich i get the value of X, Y of an object.
So please suggest me what I have to do ?
Either i have to change in XMl file or have any script for random position of X, y after getting that value from XMl????
Please Help me out.
<?xml version="1.0" encoding="utf-8"?>
<items>
<item id="1" nme="object1" path="images/a.png" price="250" xpos="20" ypos="300"/>
<item id="2" nme="object1" path="images/b.png" price="320" xpos="80" ypos="300"/>
<item id="3" nme="object1" path="images/c.png" price="190" xpos="140" ypos="300"/>
<item id="4" nme="object1" path="images/d.png" price="120" xpos="200" ypos="300"/>
<item id="5" nme="object1" path="images/e.png" price="110" xpos="260" ypos="300"/>
<item id="6" nme="object1" path="images/a.png" price="900" xpos="320" ypos="300"/>
<item id="7" nme="object1" path="images/c.png" price="250" xpos="380" ypos="300"/>
<item id="8" nme="object1" path="images/d.png" price="310" xpos="440" ypos="300"/>
<item id="9" nme="object1" path="images/e.png" price="190" xpos="500" ypos="300"/>
<item id="10" nme="object1" path="images/c.png" price="120" xpos="560" ypos="300"/>
<item id="11" nme="object1" path="images/e.png" price="110" xpos="620" ypos="300"/>
<item id="12" nme="object1" path="images/a.png" price="900" xpos="680" ypos="300"/>
</items>