-
toString()? trouble converting interger to string.
Hey folks. I feel like this is a pretty basic javascript questions. I’m creating a toolkit and wish to use a dropdown menu to control the selection of a shape layer to use as a matte. However, whenever I try to convert the interger Im getting out of a dropdown menu expression control effect, I’m running into issues. I’m trying to get this expressions to return the string: “Crop_01” but instead, it’s returning “Crop_0[object property]”
a=thisComp.layer(“BackgroundControls”).effect(“CropSelection”)(“Menu”).toString();
“Crop_0″+aThe strange part is that if I remove “toString()” I get “NaN.” Also, if I replace variable a with just the integer “1”, I get it to read properly. Does anyone know what’s going on? Doe dropbown menus return strings? or am I using toString improperly?
I’m half a mind to use a series of “else if().” to get this working for now, but this problem is bugging me.