Drag Within Bounded Space

Published :
Author :
Adam Khoury
Learn how to drag within set bounds or boundaries. You can easily set the edges or area of drag in Flash. Download the free fla file to get at all of the code and see how Adam takes a rectangle and uses it as the drag bounds. The way he coded it dynamically will allow you to place any size objects for the boundaries rectangle, and any size object for the draggable movieclip. No need to even adjust numbers. Simply put what you want in place, give it the correct instance name, and you are all set. The math equations he has in it take care of the differences in values to give perfect dynamic bounds results in simple code.