Mouse wheel and mouse panning control.

Q&A about the latest versions
Post Reply
jotec
Posts: 30
Joined: Sat Nov 01, 2008 1:05 pm
Location: Worcester England

Hi,
I have been asked if it is possible to reverse the action of the mouse wheel for zooming in the swfs also if it is possible to limit the speed the viewer can move at when panning with the mouse.
I can not think of a way of doing it, can it be done?

Thanks
D ick
Firefoxer
Posts: 27
Joined: Wed Sep 17, 2008 3:01 pm

And I was asking it few weeks ago.
jotec
Posts: 30
Joined: Sat Nov 01, 2008 1:05 pm
Location: Worcester England

Firefoxer wrote:And I was asking it few weeks ago.
Have you had any ideas?

D ick
Firefoxer
Posts: 27
Joined: Wed Sep 17, 2008 3:01 pm

To increase the speed of moving when pressing on arrows on keyboard I wrote this code:

Code: Select all

_root.createEmptyMovieClip('keycontrol',this.getNextHighestDepth());
var keyobj = new Object();
Key.addListener(keyobj);
keyobj.onKeyDown = function() {
	keycontrol.onEnterFrame = function() {
		//trace(Key.getCode());
		if (Key.getCode() == 37) {
			_root.pages.page1.all.cont.contpan.pano.setPan(_root.pages.page1.all.cont.contpan.pano.getPan()+8);
		}
		if (Key.getCode() == 39) {
			_root.pages.page1.all.cont.contpan.pano.setPan(_root.pages.page1.all.cont.contpan.pano.getPan()-8);
		}
		if (Key.getCode() == 38) {
			_root.pages.page1.all.cont.contpan.pano.setTilt(_root.pages.page1.all.cont.contpan.pano.getTilt()+5);
		}
		if (Key.getCode() == 40) {
			_root.pages.page1.all.cont.contpan.pano.setTilt(_root.pages.page1.all.cont.contpan.pano.getTilt()-5);
		}
	};
};
keyobj.onKeyUp = function() {
	delete keycontrol.onEnterFrame;
};
To control mouse wheel you need to make listener and control interaction as you want.
Post Reply