AE Expressions question - why isn't my code working? I can't figure out why I'm getting the error... Any ideas?! I tried adding "var" at the beginning of the first line, but that didn't work. Not sure what to try now! Help anyone?

Below is my code. The error reads: "object of type Layer found where a number, array or property is needed."



timeOffset=thisComp.layer("Mograph Control").effect("timeOffset(frames)")("Slider")/24;
myIndex=thisComp.layer("DotMaster")-index;


seedRandom=(index, timeless=false);
randomTimeAmount=thisComp.layer("Mograph Control").effect("randomTime(frames)")("Slider")/24;
randomActualAmount=random(-randomTimeAmount, randomTimeAmount);

baseTime+(myIndex*timeOffset)+randomActualAmount;
Typo on line 2. It should be thisComp.layer("DotMaster").index not -index.

Also, while it's valid, the first parameter to the random function on second last line -randomTimeAmount makes me nervous. I'd recommend changing it to 0-randomTimeAmount. It's more explicit, and less prone to accidental typos.