# Mouse controlled char + scrolling

**URL:** <https://forum.kirupa.com/t/mouse-controlled-char-scrolling/65306>\
**Category:** Uncategorized\
**Created:** [September 24, 2004, 9:11pm UTC](https://forum.kirupa.com/t/mouse-controlled-char-scrolling/65306 "2004-09-24T21:11:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anei](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Anei](https://forum.kirupa.com/u/Anei)\
**Post date:** [September 24, 2004, 9:11pm UTC](https://forum.kirupa.com/t/mouse-controlled-char-scrolling/65306/1 "2004-09-24T21:11:47Z")

</div>

I’ll use this as an example:  
[http://www.flashkit.com/movies/Games/RPG\_-\_en-Itamar\_L-7738/index.php](http://www.flashkit.com/movies/Games/RPG_-_en-Itamar_L-7738/index.php)

How would I make it so when the character gets to the edge of the screen it scrolls to show more of the map? When using a mouse that is.  
[http://www.tonypa.pri.ee/tbw/tut14.html](http://www.tonypa.pri.ee/tbw/tut14.html) is a tutorial for scrolling when the character is controlled by the keyboard but I have no idea how to setup something like that when they are controlled by mouse.

Is it even possible to do in flash? It seems like it would be but I haven’t seen any games that even work like that. Any help is appreciated, this is driving me nuts. XD

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2004, 6:40am UTC](https://forum.kirupa.com/t/mouse-controlled-char-scrolling/65306/2 "2004-10-02T06:40:34Z")

</div>

no help at all?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 3, 2004, 2:02am UTC](https://forum.kirupa.com/t/mouse-controlled-char-scrolling/65306/3 "2004-10-03T02:02:41Z")

</div>

```auto

if(this._x<0)
{
    _root.bg._x-=550;
    this._x = 550;
}
else if(this._x>550)
{
    _root.bg._x+=550;
    _this._x=0;
}

```

Put that on your character that moves inside of the “onClipEvent(mouseMove)” code. That will hopefully work.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 3, 2004, 7:27am UTC](https://forum.kirupa.com/t/mouse-controlled-char-scrolling/65306/4 "2004-10-03T07:27:23Z")

</div>

Yes this is definately possible, good swapdepths in that game, u should be able to do it pretty simply with tonypa’s, there’s a scrolling one and theres a mouse controlled one, therefore just combine the two together, ie use the scrolling one as a base, but make it mouse controlled, this should only take u like 10mins of cutting and pasting, or less even
