hallo,
habe ein script welches xml dateien in flash importiert. Den für das problem wichtigen teil zeige ich kurz :
PHP
1content1.onLoad = function(success){
if(success)
{
text1.htmlText = content1;
}
}
content2.onLoad = function(success){
if(success)
{
text2.htmlText = content2;
}
}
content3.onLoad = function(success){
if(success)
{
text3.htmlText = content3;
}
}
Alles anzeigen
und so weiter
Nun ist das natürlich recht umständlich / unschön, deswegen habe ich ne schleife eingebaut und die namen inkrementiert, auch innerhalb der if abfrage mitHilfe einer id :
PHP
for(var i = 1;i<=s;i++){
var k = ['content'+i];
var l = ['text'+i];
this[k].id = i;
this[l].id = i;
this['content'+i].onLoad = function(success){
if(success)
{
['text'+this.id]htmlText = ['content'+this.id];
trace(['text'+this.id]);
trace(['content'+this.id]);
}
}
Alles anzeigen
Das klappt komischer weise net, obwohl die ausgabe dann content 1, content 2 3 usw und text 1, text2 usw bis 7 traced ...
wisst ihr y das net funzt ?