Dynamic scaling in stick-slip friction