-
1. Re: Can you help? Is there a simpler way to write this short code?
hemanth kumar r Apr 15, 2014 10:24 PM (in response to jamesfootight)One obivious way to increase efficiency is
var USA_animation = sym.getSymbol("USA_animation")
USA_animation.play();
sym.getSymbol("World_map").play();
USA_animation.$("UK").fadeOut();
USA_animation.$("Piechart" ).fadeOut();
USA_animation.$("people"). fadeOut();
USA_animation.$("PeopleText").fadeOut();
USA_animation.$("UKText").fadeOut();
USA_animation.$("AUSTRALI A").fadeOut();
USA_animation.$("USA").show();
USA_animation.$("USAText" ).show();
If you were performing a single operation on all the child symbols of 'USA_animation' you could further reduce it to somethinng like
sym.getSymbol("World_map").play();
var USA_animation = sym.getSymbol("USA_animation")
USA_animation.play();
var childSymbols = USA_animation.getChildSymbols(); f
for(var i=0; i<childSymbols.length; i++)
childSymbols[i].fadeOut();
I am not sure if these are the best possible ways,but these are some ways i could think of.
Let us know if you come up much shorted way to write this
-
2. Re: Can you help? Is there a simpler way to write this short code?
jamesfootight Apr 19, 2014 1:55 AM (in response to hemanth kumar r)Great stuff thank you!


