homepage Welcome to WebmasterWorld Guest from 54.227.20.250
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
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

5+ Year Member



 
Msg#: 3915161 posted 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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved