group mc in some array or object, set valu viafunction to all memebers in group

var group1=[al_mc,lor_mc,frc_mc,cha_mc,npc_mc,pic_mc]
var group2=[ho_mc, pro_mc, bou_mc, lan_mc, auv_mc]
var group3=[d_mc, aqu_mc, lim_mc, poi_mc, cen_mc]
var group4=[_mc, han_mc, ban_mc, pad_mc, bre_mc]
function setPropInGroup (group,prop,val){
for (var i in group){ group[i][prop]=val
   }
}
function getScale(mc:MovieClip) {
   setPropInGroup(group1,"_xscale",r)
//al_mc._xscale = lor_mc._xscale=frc_mc._xscale=cha_mc._xscale=npc_mc._xscale=pic_mc._xscale=r;
   setPropInGroup(group2,"_xscale",mi)
//ho_mc._xscale = pro_mc._xscale=bou_mc._xscale=lan_mc._xscale=auv_mc._xscale=mi; setPropInGroup(group3,"_xscale",idf) //d_mc._xscale = aqu_mc._xscale=lim_mc._xscale=poi_mc._xscale=cen_mc._xscale=idf; setPropInGroup(group4,"_xscale",100) //_mc._xscale = han_mc._xscale=ban_mc._xscale=pad_mc._xscale=bre_mc._xscale=100; //...etc al_mc._yscale = lor_mc._yscale=frc_mc._yscale=cha_mc._yscale=npc_mc._yscale=pic_mc._yscale=r; ho_mc._yscale = pro_mc._yscale=bou_mc._yscale=lan_mc._yscale=auv_mc._yscale=mi; d_mc._yscale = aqu_mc._yscale=lim_mc._yscale=poi_mc._yscale=cen_mc._yscale=idf; _mc._yscale = han_mc._yscale=ban_mc._yscale=pad_mc._yscale=bre_mc._yscale=100;
   //
al_mc._alpha = lor_mc._alpha=frc_mc._alpha=cha_mc._alpha=npc_mc._alpha=pic_mc._alpha=rho_mc._alpha=pro_mc._alpha=bou_mc._alpha=lan_mc._alpha=auv_mc._alpha=mid_mc._alph; a = aqu_mc._alpha=lim_mc._alpha=poi_mc._alpha=cen_mc._alpha=idf_mc._alpha=han_;
   mc._alpha = ban_mc._alpha=pad_mc._alpha=bre_mc._alpha=0;
   //
al_mc.enabled = lor_mc.enabled=frc_mc.enabled=cha_mc.enabled=npc_mc.enabled=pic_mc.enabled=r; ho_mc.enabled = pro_mc.enabled=bou_mc.enabled=lan_mc.enabled=auv_mc.enabled=mi; d_mc.enabled = aqu_mc.enabled=lim_mc.enabled=poi_mc.enabled=cen_mc.enabled=idf; _mc.enabled = han_mc.enabled=ban_mc.enabled=pad_mc.enabled=bre_mc.enabled=fals;
   e;
   //
   mc._yscale = 300;
   mc._xscale = 300;
   mc._alpha = 100;
   //    mc.enabled = true;
   mc._x = (550-mc._x)/2;
   mc._y = 0;
}


Laurent CUCHET wrote:
How can I simplify this ?

Thak you

function getScale(mc:MovieClip) {
    al_mc._xscale =
lor_mc._xscale=frc_mc._xscale=cha_mc._xscale=npc_mc._xscale=pic_mc._xscale=r
ho_mc._xscale=pro_mc._xscale=bou_mc._xscale=lan_mc._xscale=auv_mc._xscale=mi
d_mc._xscale=aqu_mc._xscale=lim_mc._xscale=poi_mc._xscale=cen_mc._xscale=idf
_mc._xscale=han_mc._xscale=ban_mc._xscale=pad_mc._xscale=bre_mc._xscale=100;
    //
    al_mc._yscale =
lor_mc._yscale=frc_mc._yscale=cha_mc._yscale=npc_mc._yscale=pic_mc._yscale=r
ho_mc._yscale=pro_mc._yscale=bou_mc._yscale=lan_mc._yscale=auv_mc._yscale=mi
d_mc._yscale=aqu_mc._yscale=lim_mc._yscale=poi_mc._yscale=cen_mc._yscale=idf
_mc._yscale=han_mc._yscale=ban_mc._yscale=pad_mc._yscale=bre_mc._yscale=100;
    //
al_mc._alpha = lor_mc._alpha=frc_mc._alpha=cha_mc._alpha=npc_mc._alpha=pic_mc._alpha=rho_mc
._alpha=pro_mc._alpha=bou_mc._alpha=lan_mc._alpha=auv_mc._alpha=mid_mc._alph
a=aqu_mc._alpha=lim_mc._alpha=poi_mc._alpha=cen_mc._alpha=idf_mc._alpha=han_
mc._alpha=ban_mc._alpha=pad_mc._alpha=bre_mc._alpha=0;
    //
    al_mc.enabled =
lor_mc.enabled=frc_mc.enabled=cha_mc.enabled=npc_mc.enabled=pic_mc.enabled=r
ho_mc.enabled=pro_mc.enabled=bou_mc.enabled=lan_mc.enabled=auv_mc.enabled=mi
d_mc.enabled=aqu_mc.enabled=lim_mc.enabled=poi_mc.enabled=cen_mc.enabled=idf
_mc.enabled=han_mc.enabled=ban_mc.enabled=pad_mc.enabled=bre_mc.enabled=fals
e;
    //
    mc._yscale = 300;
    mc._xscale = 300;
    mc._alpha = 100;
    //    mc.enabled = true;
    mc._x = (550-mc._x)/2;
    mc._y = 0;
}
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to