ThilagamSakkara
2 years agoCommunity Member
Change state of the shape based on the value of the variable using Javascript
I do have a shape(Rectangle 1) in my timeline and added multiple states(10, 20, 30). I have also created few variables which changes based on check box status. Now I want to edit the state of the rectangle based on these variable values using javascript.
var getprogressrectangle = document.querySelectorAll("[data-acc-text='Rectangle 1']");
if (userval1 == 1 && userval2 == 0){
getprogressrectangle.setState({state: "30"});
}else{getprogressrectangle.setState({state: "10"});}
But I'm getting "getprogressrectangle.setState is not a function" error.
Any help would be much appreciated!!