actionscript 3 - Add child on dynamic component name -
actionscript 3 - Add child on dynamic component name -
as must add together image on several grouping on same form, i'd customize procédure that.
indeed, actualy, have that,
if(value=="17"){ gv17.addelement(imac); v17.setstyle("backgroundcolor",'#ffffff'); }
my goal 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 have solution solve that. indeed, think it's stupid write x times (3 in example) that. can refer object name name string. i'd :
var mytarget:string = "gv16"; mytarget.addelement(imac);
thanks
depending on how objects named, might try:
this['gv' + value].addelement(imac); this['v' + value].setstyle('backgroundcolor', '#ffffff');
as long value number equates symbol name numbers, , logic holds true every element, should solve problem without getting overly complex.
actionscript-3 flex air flash-builder
Comments
Post a Comment