here string constrain is applied... it states that the velocity component of the two ends of a tight string (having some tension), along the string are equal...because the length of the string should be fixed....so both ends will move equal dist in equal time intervals...
now if the mass move with vel v upwards.. the vel component along the string AM will be equal to vcost