I have the below code and i want to replace the code at run time depending on a variable value, how do i achieve this using javascript. Also please ignore the FormA , animate etc as they are used by kony mobile.
//desired out put inside the run time code. 
    FormA.ItemFlexContainer0.animate
    //index has a value of 0 for now. 
    var index = 0;
    var ItemFlexContainerString = "ItemFlexContainer"+index;
    FormA.ItemFlexContainerString.animate
    Error :- Type Error null is not an object 
Since ItemFlexContainerString doesnt exist it will throw the error.
 
    