Domanda

Say I have these variables

var word1 ='wordA';
var word2 ='wordB';
var word3 ='wordC';
var word4 ='wordD';
var word5 ='wordE';

and I have this loop

for (var i=1; i<6; i++) {
    // make word + i = ''; (an empty string)
}

how would I go about doing so using Actionscript 2?

È stato utile?

Soluzione

Try this:

for (var i=1; i<6; i++) {
    this[ "word" + i ] = ''; (an empty string)
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top