Yes, create a condition that test if the button is pressed (using the "on click" condition if you are using the actual Button plugin, or testing if the mouse clicked you sprite if you used a sprite as a button)
Then, supposing you already created your loop condition, drag and drop it inside the click condition. This is very basic stuff, you should check out the tutorials