omskrivning til dynamisk flash
Jeg har følgende koden:tempNr2 = node.childNodes[3].childNodes[i].childNodes[3].childNodes[u].childNodes[3].childNodes[l].childNodes[3].childNodes.length;
if (tempNr2)
{
for (var f = 0; f < tempNr2; f++)
{
tempShort3 = tempShort2["diagramBox" + l];
tempShort3.attachMovie ("diagramBox", "diagramBox" + f, 100 + f);
tempShort3["diagramBox" + f]._y += yOffset;
tempShort3["diagramBox" + f]._x += -60 + (120 * f);
//
tempShort3["diagramBox" + f].bground.onPress = function ()
{
trace ("ooohahahaha");
};
tempShort3["diagramBox" + f].textFelt.text = node.childNodes[3].childNodes[i].childNodes[3].childNodes[u].childNodes[3].childNodes[l].childNodes[3].childNodes[f].firstChild.firstChild.nodeValue;
tempNr3 = node.childNodes[3].childNodes[i].childNodes[3].childNodes[u].childNodes[3].childNodes[l].childNodes[3].childNodes[f].childNodes[3].childNodes.length;
trace ("tempNr3 = " + tempNr3);
if (tempNr3)
{
for (var g = 0; g < tempNr3; g++)
{
tempShort4 = tempShort3["diagramBox" + f];
tempShort4.attachMovie ("diagramBox", "diagramBox" + g, 100 + g);
tempShort4["diagramBox" + g]._y += yOffset;
tempShort4["diagramBox" + g]._x += -60 + (120 * g);
//
tempShort4["diagramBox" + g].bground.onPress = function ()
{
trace ("ooohahahaha");
};
tempShort4["diagramBox" + g].textFelt.text = node.childNodes[3].childNodes[i].childNodes[3].childNodes[u].childNodes[3].childNodes[l].childNodes[3].childNodes[f].childNodes[3].childNodes[g].firstChild.firstChild.nodeValue;
}
}
}
}
Da det der sker i de 2 løkker er næsten identisk vil jeg gerne lave en mere generel funktion jeg kan kalde.
Er der nogen der kan hjælpe?
vh
KalleBalle
