How to pass an integer to create new variable name?
- by Joe
I have 50 svg animations named animation0, animation1, animation2 etc. and I want to load them when the integer 0 to 49 is passed to this function:
function loadAnimation(value){
var whichswiffy = "animation" + value;
var stage = new swiffy.Stage(document.getElementById('swiffycontainer'), whichswiffy);
stage.start();
}
It doesn't work at the moment, maybe it's passing 'whichswiffy' rather than 'animation10'?
Any ideas?