Thanks for the reply, but that is not working. I’ll give a bit more information:
It’s a Mr. Potato Head and this is for the function that lets people view heads from a database that other people have submitted. You can see it at http://www.snailgames.tk/games/potatohead.
The ASP file outputs in this format: tname=Ian&tpname=eye2|mouth4|nose3&tpx=172|169|160&tpy=143|297|215&tpxscale=100|100|100&tpyscale=100|100|100&tprotation=0|0|0
This is the Action Script in the main timeline so far:
[INDENT]stop();
loadVariablesNum(“viewHead.txt”, 0);
for (i = 1; i <= CountParseString(vpartname, “|”); i++) {
_root.attachMovie(ParseString(tpname, “|”, i), “part” + i, i);
_root[“part” + i]._x = ParseString(tpx, “|”, i);
_root[“part” + i]._y = ParseString(tpy, “|”, i);
_root[“part” + i]._xscale = ParseString(tpxscale, “|”, i);
_root[“part” + i]._yscale = ParseString(tpyscale, “|”, i);
_root[“part” + i]._rotation = ParseString(tprotation, “|”, i);
}
function CountParseString(str, char) {
temp = 1;
for (f = 0; f <= str.length; f ++) {
if (str.charAt(f) == char) {
temp ++;
}
}
return(temp);
}
function ParseString(str, char, section) {
temp = 1;
str = str + “|”;
for (f = 0; f <= str.length; f ++) {
if (temp == section) {
temp = “”;
for (g = f; g <= str.length; g++) {
if (str.charAt(g) != char) {
temp += str.charAt(g);
} else {
return(temp);
}
}
}
if (str.charAt(f) == char) {
temp ++;
}
}
}[/INDENT]
In that for loop, it takes the variables it is supposed to be getting, and uses them to attach the face features and give them _x, _y etc. CountParseString is a function that returns the sections in str separated by char. ParseString is a function that returns the value of section in str separated by char.
I hope this helps.