homepage Welcome to WebmasterWorld Guest from 54.205.242.179
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Problem with an if statement.
I am having a problem with a variable in an if statement.
MartinWeb




msg:3915163
 12:10 am on May 17, 2009 (gmt 0)

I am currently trying to make a game that involves many spaces for the pieces to go on. I keep track of what piece is on each square with the use of many variables. So, for example, the first square has an attached variable called "s1", the second square has an attached variable called "s2", and so on. I tried to run the following code, to make the pieces move-

var op = 6; //This is just an example, this would actually be based on the piece that is clicked on.

if(_root.s&var(op)=='0'){ //if nothing is on it
_root.move.gotoAndPlay(op);
}

I continuously get error messages involving the if statement. I want it to turn into, " if(_root.s6=='0'){".

Do you know how to fix this?

Please help!

Thanks!

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved