Not recognize variable in number

Hello

Let's see if I can explain what I'm trying to do, and what the problem is.

Basically, I'm telling a symbol to be moved from its current position to another. But rather than put a number behind symbol._x = I placed a variable. For some reason, the symbol won't spend the number of coordinate x which is stored in the variable.
Why not??? I used a trace on the variable which reads a number, and I also replaced the variable behind the _x with a regular number in which case the symbol moves...

More background and code:
I have an XML that stores the coordinates x and y for the various items in the database of the file.
All the information from the XML file are stored in an array,
Example of XML data:
< person >
< name > Fred < / name >
< profession > Baker < / profession >
< > 150 xcoordinate < / xcoordinate >
< ycoordinate > 25 < / ycoordinate >
< / person >
< person >
...

The table looks like this:
var aPerson:Array = new Array();
var xPersonData:XML = new XML();
xPersonData.ignoreWhite = true;
xPersonData.load ("People.xml");
xPersonData.onLoad = {function (success:Boolean)}
If (success) {}
var numPeople:Number = xPersonData.firstChild.childNodes.length;
for (var i: Number = 0; i < numPeople; i ++) {}
Missing [i] = new Object();
Missing [i] .personName = xPersonData.firstChild.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [0] .firstChild;
.profession missing [i] = xPersonData.firstChild.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [1] .firstChild;
Missing [i] .xmap = xPersonData.firstChild.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [2] .firstChild;
Missing [i] .ymap = xPersonData.firstChild.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [3] .firstChild;
}

Later depending on the button you press on the following code is supposed to load some information about the selected person, as well as move a circular symbol pin specific x / coordinate on top a card:

LoadPic = function (imageNumber) {}
XCO missing = [imageNumber] .xmap;
yco missing = [imageNumber] .ymap;
trace (XCO);
trace (yco);
mc_largeImage.txt_name. Text missing = [imageNumber] .personName;
mc_largeImage.txt_profession.htmlText = .to go missing [imageNumber];
mc_largeImage.mc_map.mc_pinmap._x = xco;
mc_largeImage.mc_map.mc_pinmap._y = yco;
}

If I use the XML example above, the trace of the two variables (xco and yco) reads 150 and 25, but the symbol does not move anywhere. If I replace the xco behind mc_largeImage.mc_map.mc_pinmap._x = with a number, that it moves to a different location. So it is not a question of not speaking correctly the symbol...

THEN! What happens here? Can someone help me please?
Is there something special about the number stored in a table? It don't think it's a chain and not a number?

Would be grateful if someone could point me in the right direction :-)
Thank you
JJ

The content of the XML textNodes is of type String. And to get there, you need to use the nodeValue property for textNodes. Otherwise, which you access is actually an XMLNode, which traces OK using its ToString method (which automatically trace uses), but don't not provide you the string value if you use it in the code. In fact using toString() or nodeValue property should also work well here.
If the numbers you read in your xmap and ymap person your object properties are of type XMLNode.
To get the string values and then convert them to numbers, try to change the following two lines:

Missing [i] .xmap = xPersonData.firstChild.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [2] .firstChild;
Missing [i] .ymap = xPersonData.firstChild.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [3] .firstChild;

Replace:

Missing [i] .xmap = number (xPersonData.firstChild.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [2].firstChild.nodeValue);
Missing [i] .ymap = number (xPersonData.firstChild.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [3].firstChild.nodeValue);

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • Recommendation for the DAQ card

    Hi guys, =) I m currently developing a project in a gas control, where I need Messure tempertures and be able to open and close a valve. My implementation are 4 termocouples and 4 relays to turn off the valves and... I was hoping if someone could hel

  • Upgrade RAM HP Pavilion DV4 2045DX

    I have a HP Pavilion DV4 2045DX I currently have 4 GB of RAM (3.75 usable) I need at least 4 GB usable. I wanted to make sure it can handle more RAM, I was wondering how much it would let me put off in it... What Cup is? I can't seem to find this inf

  • No sound from BOSE speakers

    I had posted this question9Issue) before, but I've not been able to solve. I have no sound from my external speakes. I used the troubleshooter, but it says «he can't identify problem» I checked my connection to the taking of correct alignment. Any ad

  • Graph of temporal events

    I have what I think should be a pretty simple problem to solve, but I just can not work begin. I have an 'event' - not a LabVIEW event, but a thing that happens. I measure when it starts when it stops happening and carry forward the value of the time

  • How to remove an unwanted program / application

    a program called Vcg is installed but I can't delete because it keeps giving me the message that I don't have the right to remove it.