1 Reply Latest reply on May 16, 2006 5:57 AM by Newsgroup_User

    help plz

    Abyu
      can any bodyhelp me
      the actionscript is not working
      if (_y+_height/2 == 455) {
      trace("Collision");
      }
      if i use 600 instead of 455 it is working but not working of anyother values other than 600;
      please help me
        • 1. Re: help plz
          Level 7
          Abyu,

          > can any bodyhelp me

          I'll try.

          > the actionscript is not working
          > if (_y+_height/2 == 455) {

          So let's see what we have. You have a math expression in an if()
          statement. This checks the value of a property _y and adds it to the
          quotient of the value of a property _height divided by two. If the result
          is equivalent to 455, something will happen.

          > trace("Collision");
          > }

          Aha, a trace of "Collision" will happen.

          > if i use 600 instead of 455 it is working but not working
          > of anyother values other than 600;

          Clearly, this means that 600 is the only mathematical answer, here.

          > please help me

          I'm not sure how I can! You're saying (for example) 300 + (600 / 2)
          is only true if you say it equals 600 -- well, those numbers *do* equal 600,
          so of course only 600 will work.

          What is this ActionScript supposed to do? What is the value of _y and
          _height here?


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."