# Flash and IF Statement &\*^%$&

**URL:** <https://forum.kirupa.com/t/flash-and-if-statement/228434>\
**Category:** flash\
**Created:** [June 7, 2007, 6:15pm UTC](https://forum.kirupa.com/t/flash-and-if-statement/228434 "2007-06-07T18:15:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtplayte](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jtplayte](https://forum.kirupa.com/u/jtplayte)\
**Post date:** [June 7, 2007, 6:15pm UTC](https://forum.kirupa.com/t/flash-and-if-statement/228434/1 "2007-06-07T18:15:12Z")

</div>

Hi Folks,

very new to flash, learning lots, traditional procedural programmer (i.e. Turing in the 80’s)

The following piece of code is not the program, just the part I am having trouble with.

I want the code to enter the “else” section, but it does not

var ticks = 10;  
var m = 3;  
var b = 1;  
var numbpt = 0;  
y = ticks;  
x = (y-b)/m;  
if ((x\>-ticks) && (x\<ticks)) {  
numbpt = numbpt+1;  
if (numbpt=2) {  
point2x = x;  
point2y = y;  
trace(“numbpt=2 business”);  
} else {  
trace (“Should be here, but not!!!”);  
trace(x);  
trace(y);  
point1x = x;  
point2y = y;  
}  
}

Any help would be appreciated.

jtp

p.s. Program is a game that involves plotting y=mx+b equations on a grid
