Intermittent Continuity Query

Hello all, this is my first posting to this site. It’s a really good and informative site, and I’m having difficulty with Flash actionscript. I’m an intermediate level user, but I’ve seen some great posts in this forum, and I know there’s some brainy types that read this. Here goes…

I’m working for a client that wants me to create an interactive map, which I can zoom in/out, move the map around, have a minimap guide, and other goodies. I’ve got the bulk of it created, but I got stuck trying to create a gamepad type controller which the user can click on, and it will move the map.

What I’m trying to do is this: The gamepad graphic I created is like a typical Playstation/X-box style thumbpad controller. There are an up, down, left, and right arrows graphic which the user can click to make the map go up, down, etc. (I have created code to let the users use the keyboards, in case they don’t want to use the graphics)

Is it possible to create a continous movement when the mouse is pressed, or will my poor user be stuck clicking the mouse ad-nauseum?

Any help/suggestions offered will be greatly appreciated. Thanks.

Here’s an example of the code I’m using:

*on (press) {

//move map left
_root.map._x-=5;

}*
Thanks, again…

on your _root… with an instance btn to click and an instance map that moves around

btn.onPress = function() {
this.onEnterFrame = function() {
_root.map._x -= 5;
};
};
btn.onRelease = function() {
delete this.onEnterFrame;
};

That’s one way. BUT you should have a look at listeners. They are way underused and are a great pain-reliever (when you get to understand, which, granted, is not easy at first)

[edit] welcome aboard the great Kirupa Bandwagon… where are my f***ing manners?? :smiley: [/edit]

YAHOO!!! That worked! I’ll have to mess around with the code now. Thanks. I appreciate the help.

By the way, what are “listeners?”

Thanks again.

http://www.kirupa.com/developer/actionscript/asbroadcaster.htm