How to move an object with one key press

Apr 10, 2018

I want to be able to move an "object", in this case, a rectangle shape with the tab key. I am trying to emulate an interface (similar to a 1998 IBM menu) with a green rectangle. I want the green rectangle to move up/down next to numbers with just one key (in this case the Tab key). Each key press would move the rectangle a certain amount of pixels. For example, 10 pixels down when a learners presses the Tab key and so forth.

So, how do I create an object that can move every 10 pixels down with one key multiple times. I assume I can then change the direction with a different key press such as a Shift+Tab. When I have two columns, do I need to change something (such as a path) so that it looks like it jumps from the bottom left to the top right.

One additional feature I would like is a slow blinking green rectangle. What is the best approach to create this object?

4 Replies
Michael Hinze

Using the Tab key is tricky because this key is used for accessibility. See attached a quick example that shows how to move an object up/down with ArrowUp and ArrowDown keypresses. The blinking rectangle on the right was done by toggling its states based on an offstage looped animation. And yes, you could also use a slider.

This discussion is closed. You can start a new discussion or contact Articulate Support.