A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Two values

  1. #1
    Senior Member
    Join Date
    Dec 2003
    Location
    Uk
    Posts
    190

    Two values

    I have a movieclip, when u click it it makes thrust=true. Then if you click it again I want it to make thrust=false

    I can make it make thrust=true, thats easy, but if you click it again it'll turn thrust=false, and then if you click it again it makes thrust=true and so on...

    Please can someone help me, it's driving me crazy, I can't think.

    I hope I explained my problem good enough.

  2. #2
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    Just need a simple if
    Code:
    if(thrust) { //if thrust is true
        thrust = false;
    }else{ //if thrust is false
        thrust = true;
    }

  3. #3
    Senior Member
    Join Date
    Mar 2005
    Posts
    147
    Code:
    on (release) {
    if (thrust == true) {
    thrust = false;
    //anything else
    }
    else if (thrust == false) {
    thrust == true;
    //anything else
    }
    }
    joechilds@imap.cc
    www.blackliquor.co.uk

  4. #4
    Senior Member
    Join Date
    Dec 2003
    Location
    Uk
    Posts
    190
    Thank you very much for the quick responses.

  5. #5
    Senior Member Giraph's Avatar
    Join Date
    Nov 2003
    Location
    Michigan
    Posts
    161
    or even simpler
    Code:
    thrust=!thrust

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center