I have some code that looks like this:
ActionScript Code:
level_btn.x = 50 + (i - 1) % 10 * 50;
it sets the x location of my level button. But this is in a for loop (that's what the 'i' is for.)
I run it and everything works perfectly, as it should, not a single problem.
Then I press the auto format button in the flash actionscript editor. (It's the button that adds all of the ; to the end of each line and other stuff)
Well that changes my code to this:
ActionScript Code:
level_btn.x = 50 + i - 1 % 10 * 50;
thinking it's done me a favour but it hasn't. It's got rid of the brackets so it won't do the maths functions in the correct order.
I've tried adding more brackets in places and other stuff but I just don't know how to fix it. It's annoying because every time I press the auto format button I have to add the brackets in again. Does anyone know how to fix this bug in flash?