try if (i==1) double equal.
I had tried the "double equal" in eariler versions. I guess it was something else that was breaking it at the time. Learning by trial and error is surely a pain sometimes. Anyway, its works fine now. Now I'll try it with all the code inserted.
Is there a more elegant way of turning off the click monitoring after it reaches 3 clicks than what I'm doing ??
1- when you initialize a variable, you do use only one equal because it is a value that is set.
2- when you compare as in an if statement, you use ==, <=, >=, !=, etc.... These are logical operators. See: http://www.w3schools.com/js/js_comparisons.asp
3 - you could do it a little differently with i++ which increments by 1 each time. Below is an example.
Let suppose I have a button on the stage called btn here is how I do it but this is by no means the only solution.
// increment by 1
// increments from 0 to 3 then stops
// plays the labels: timeLineLabel0, timeLineLabel1,timeLineLabel2,timeLineLabel3
sym.play('timeLineLabel' + i);
// resets the counter i to zero and starts over
you could also use i-- to go down in the other direction from 3 to 0 - you could also start at 1 like in your example.
I hope this helps you correct your code for your own purposes.
I have it all working now with my other code in place. It's not polished but it's not broke either. once i get all the pieces in place I will try to streamline.
thanks for your help
Bravo.... I just don't have the words to explain the happiness I'm feeling right now with your answer. I tried your code slightly modified with respet to my project and it worked BEAUTIFULLY. Thanx a million, trillion, gazillion.... thank you so very much.
I just posted a question regarding my issue and was doing searching on this very topic for around 3-4 days without results. While I was posting my question, I somehow chose the right words, posted my questions, later thought of searching for answer with the same right words and bamn, stumbled on this thread. I got my question answered. So thank you very much.
Here's a link to my question:
Glad this could help you! Good luck on your project!