>>
The thing is that the buttons are used as sensors, meaning that we use the
buttons to detect if some block is available (i.e. item isn't removed from
his stationary) now we want to be able to reorder this four block
elements. Only I am not sure how I can detect if the order, is a expected.
Because of the continous key events.
>>
When I've done this in the past the thing to remember is that its a lot
easier if you use "Key.isDown" rather than "onKeyDown" and "onKeyUp" events.
Rumour is that this function is being removed in AS3 so get it while its hot.

Here's some very rough code to show one way of doing it
**** Warning untested pseudo code written first thing in the morning ****

orderHolder = new Array()
counter = 1

onEnterFrame = function() {

if (Key.isPressed(firstKey) and orderHolder(firstKey)==null) {
  orderHolder(firstKey) = counter
  counter ++
}
if (Key.isPressed(secondKey) and orderHolder(secondKey)==null) {
.....
etc for all the keys
}

BTW You can do this without ripping apart a keyboard using a gadget called a "keyboard encoder"
Type this into google for suppliers.

Hope this helps

Joe

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to