Map KeyEvent Issue
How can I move the map until keyboard.KeyUp event dispatched ?
Not just move one time .
Not just move one time .
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Listen for key down events. On key down, add an enterframe listener. On key up, remove it. On enter frame, use map.panBy.
-
Inappropriate?MapComponent.map.addEventListener that wrote in the mxml can't catch the event.
function mapcomponentCreationCompleteHandler():void{
map.stage.fouce = map; /* stage is null ~~ Why ?*/
}
I’m sad
-
Inappropriate?This is a Flash thing, nothing to do with Flex or Modest Maps.
In a DisplayObject, stage is null until the object has been added to the stage. You should listen for Event.ADDED_TO_STAGE and Event.REMOVED_FROM_STAGE to be sure. -
Inappropriate?What time should I add keyboard listener to the map ?
I do it in the creationcomplete event but doesn't work.
I’m thankful
-
Inappropriate?I add put these code into the map.addToStage function but it dosen't work ?
private function mapAddToStage(e:Event):void
{ /* as same as the map.mouseclick */
/* but I have to click map to set the focus then the keyboardevent will be effect */
map.focusRect = false;
map.stage.focus = NeoMap.map;
map.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
map.addEventListener(KeyboardEvent.KEY_UP, keyUp);
}
I’m anxious
-
Inappropriate?Here's a standalone KeyHandler that does not need adding to the stage:
http://modestmaps.mapstraction.com/tr...
You can use a similar structure for a handler than pans continuously while a key is pressed.
Loading Profile...



EMPLOYEE