If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Although this may sound stupid to ask, but I don't know why I just can't make it so that when I press a key then the character would move left, and same for right... should I use actionscripts such as setproperty? or something to do with telltarget? because I tried set property and it only works once after pressing the key, afterward no matter how many times I press it, it still doesn't work...

On (Key: <Up>
Set Property ("", Y Position) = _y-10
End On
On (Key: <Down>
Set Property ("", Y Position) = _y+10
End On
On (Key: <Left>
Set Property ("", X Position) = _x-10
End On
On (Key: <Right>
Set Property ("", X Position) = _x)+10
End On

---WARNING ---
Using the Keyboard repeat rate as an animation timer will result in game inconsistency! Keyboard-repeat rate is not a constant, as the users can change the settings in their control panel, and there is no standard or default.
---WARNING ---

All games require a timer of some sort. Flash has a frame rate already, that would more then likely not line up with the keyboards rate.

The work around is quite simple:

1. Your Keyboard or UI (User Interface) sets variables that represent the Keys status.
2. A flash MC (Move Clip) would be set up to process the data thus keeping consistency in gamy play.

The Process MC would look at a Variable if (Var = Key Down) then call animation, and set Var back to default. Loop this in a “frame loop” for the best results experiment with different time delays and UI.

I hope this makes sense, because it will save you from lots of headaches down the rode.

No, but I think there's a tutorial on this site with a workaround... Basically involves setting a timer to trigger a keyup if a keydown hasn't been received in the last 10 frames... Too dependent on the keyboard repeat rate...

The address you were looking for

Howdy 4eyes, In fact I dont put AS in a button just a matter of style rather I pass variables to the mc time line like Key_up=1 to trigger events. after the event the variable goes back to 0. Key_up=0. So there are 2 ways of moving your guy.

1. moves till the button is down and stops when release.
2. moves all the time you give em the direction only.