How can I create variable variables in ActionScript
- by Daniel Angel
I'm doing this
mcomp7d101.onRelease = function() {
getURL("javascript:Compartir("+id7d101+");");
}
mcomp7d102.onRelease = function() {
getURL("javascript:Compartir("+id7d101+");");
}
mcomp7d103.onRelease = function() {
getURL("javascript:Compartir("+id7d101+");");
}
mcomp7d150.onRelease = function() {
getURL("javascript:Compartir("+id7d101+");");
}
you get the idea :)
How can I use a for loop to do something like:
for(ii = 101; ii < 150; ii++)
{
mcomp7d+ii.onRelease = function() {
getURL("javascript:Compartir("+id7d+ii);");
}
}
I'm getting a syntax error. It seems that I can't create variable variables in compiled languages.