Drawing inside a Scrollpane

Hi, I’m trying to create a draw program in AS2 where I can draw shapes with my mouse inside a Scrollpane. Furthermore, I need to be able to drag and drop these objects within the Scrollpane. Currently, I’m doing the following:

  1. I created an empty movie clip called main and I’m attaching it inside the Scrollpane called scroll
  2. I draw the objects inside another empty movie clip called p0, p1, p2, etc. which I’m attaching inside main.

When I drag the objects around, they can be dragged outside the boundaries of the Scrollpane. How can I prevent that from happening?

  1. create a empty movieclip in library… and call it “holder” by linkage identifier

  2. drag a scroll pane component to stage and set its contentpath parameter to “holder” by component parameter panel.

  3. if you have any problems you can also do it via actionscript
    scrollpaneinstance.contentPath=“holder”; // it will automatically attach from library

  4. store this path as:

var container=scrollpaneinstance.contentPath;

  1. Now attach what ever you want to container using you favorite attachMovieClip function

:slight_smile: hope it helps

Thank you, it sure did!!!

welcome :slight_smile: