As I must to add image on several group on the same form, I’d to customize my procédure to do that.
Indeed, actualy, I have something like that,
if(value=="17"){
gv17.addElement(imAc);
v17.setStyle("backgroundColor",'#ffffff');
}
My goal is to do something like that:
if(value=="18"){
gv18.addElement(imAc);
v18.setStyle("backgroundColor",'#ffffff');
}
if(value=="17"){
gv17.addElement(imAc);
v17.setStyle("backgroundColor",'#ffffff');
}
if(value=="16"){
gv16.addElement(imAc);
v16.setStyle("backgroundColor",'#ffffff');
}
Do you have a solution to solve that.
Indeed, I think it’s stupid to write X times (3 in example) to do that. I can refer to object by Name as name is a string.
I’d like to do something like that :
var mytarget:string = "gv16";
mytarget.addElement(imAc);
Thanks
Depending on how your objects are named, you might try:
As long as your value number equates to the symbol name numbers, and the logic holds true for every element, this should solve your problem without getting overly complex.