If your getScale function is called many times a second you should keep it the way it is. The way you currently have it is the most efficient way of doing it and will yield higher FPS.

However, if speed isn't and issue and you are not calling this function very often and want to simplify it purely from a readability standpoint then Martin's setPropInGroup() function is a good way to do that.


James O'Reilly
http://www.jamesor.com



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

Reply via email to