Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Flash Code and IF statement ?*&%^$
Index -> Graphics and Design, Web Design -> Flash MX Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jtplayte




PostPosted: Thu Jun 07, 2007 1:09 pm   Post subject: Flash Code and IF statement ?*&%^$

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
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> Flash MX Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: