2 Replies - 868 Views - Last Post: 04 March 2008 - 07:30 PM

#1 Ryan1   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 29-September 07

Basic question about if-then-else logic

Posted 04 March 2008 - 03:20 PM

okay I'm fairly new at flash, but I have used VB before. I'm using a bit of code to move and object around. That code works perfectly and I had the increments it moves in equal to a variable named A. Normally A = .5 but when shift is held down it switches to A = 1. I was wondering how I could have it so it switches back to .5 when shift is not held down. heres some of the code

if (Key.isDown(Key.SHIFT)) {
A = 1;
}



*edit* :code:

Is This A Good Question/Topic? 0
  • +

Replies To: Basic question about if-then-else logic

#2 girasquid   User is offline

  • Barbarbar
  • member icon

Reputation: 109
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Basic question about if-then-else logic

Posted 04 March 2008 - 03:46 PM

Try an else statement:
if(Key) {
} else {
A = 0.5;
}


Was This Post Helpful? 0
  • +
  • -

#3 Ryan1   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 29-September 07

Re: Basic question about if-then-else logic

Posted 04 March 2008 - 07:30 PM

thank you that worked perfectly :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1