# BitmapData button based Scrolling

**URL:** https://forum.kirupa.com/t/bitmapdata-button-based-scrolling/304718
**Category:** flash
**Created:** [February 12, 2010, 1:29pm UTC](https://forum.kirupa.com/t/bitmapdata-button-based-scrolling/304718 "2010-02-12T13:29:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cermunnos](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@cermunnos](https://forum.kirupa.com/u/cermunnos)
#### Post date: [February 12, 2010, 1:29pm UTC](https://forum.kirupa.com/t/bitmapdata-button-based-scrolling/304718/1 "2010-02-12T13:29:37Z")

</div>

I’ve checked out a lot of the tutorials on this subject on the internet and they are overly elaborate, involving cameras, in previous versions of flash i would have just messed around with x and y values and xscales and y scales.

Anyway my problems is I have a single bitmapdata image of perlinnoise 500x500 on a 500x500 stage. I’m trying to do this all in code.

Now I have a few buttons at the bottom. ScrollLeft, ScrollDown, ZoomOut Etc.

However when i make a listener to my buttons using Mouse Down im only getting a single increment of scrolling

so for example for my scroll down button

ScrollDown.addEventListener(MouseEvent.CLICK, cpAction); //or Mousedown

[INDENT]function cpAction(event:Event):void  
{  
myBitmapData.scroll(0,1);

}[/INDENT]

When i click and hold the mouse on the button im just getting 1 pixel of movement, what i want to see is the scene move smoothly while i have the mouse held down.

Additionally .scroll doesnt seem to work with floats?

Any ideas on this , thanks?:pirate3:
