Contact ZenDuo


Vertical / Horizontal Scrolling in Flash



The following examples below show how to make a movie clip in flash dragable either horizontally or vertically with set positions stopping the movie clip being dragged to far.
In these examples we will use 50 as the lowest position the object can be moved and 200 as the highest value that the object can be moved.

Verticle Scrolling (up and down):

on (press) {
startDrag(this, 0, this._x, 50, this._x, 200);
}

The opposite effect can be applied when you switch the variables and number around to this._y

Horizontal Scrolling (left and right):

on (press) {
startDrag(this, 0, this._x, 50, this._x, 200);
}

This entry was posted on Monday, September 28th, 2009 at 7:37 pm and is filed under ActionScript & Flash. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply