Hi
My question:
I would like to get a situation like this:
every n where n is a variable
do: ...
Now what we can do is:
every 1 were 1 is a constant
do: ...
This is the case or am I wrong?
I wonder how can I get the same thing!
tnks
Hi
My question:
I would like to get a situation like this:
every n where n is a variable
do: ...
Now what we can do is:
every 1 were 1 is a constant
do: ...
This is the case or am I wrong?
I wonder how can I get the same thing!
tnks












Can you please give an example usage. n can't be "a variable" because there are many types of data storage which have different ways of being iterated. For example, you could iterate through the Alterable Value A of multiple instances of an object, or the XYZ of an Array object, or the lines of a listbox. Generally speaking this would use fastloops. Are you effectively wanting a 'foreach' loop in which the subject is a specific object, and the event runs once for each instance of that object, or are you trying to access different elements of a specific object instance? Or are you just trying to make an event which runs n times?
Also, if you haven't done so already then have a look at the various tutorials at http://www.clickteam.com/eng/learning_resources.php and refer to the \examples\ folder and MMF2 CD #2 for examples on how to use specific objects.
.:::.Joshtek.:::.
I try to explain better
The EVERY condition allows only a numerical constant:
+ EVERY .25 sec
+ CHECKBOX "repeatN" CHECKED
+ CHECKBOX "auto" CHECKED
START LOOP "s" 1 times
I would get such a situation:
+ EVERY (Global Value A) sec
+ CHECKBOX "repeatN" CHECKED
+ CHECKBOX "auto" CHECKED
START LOOP "s" 1 times
I would like to use (Global Value A) and change the value during the execution, using an interactive cursor, and not only have a fixed value.
I wonder how can I do in a way so easy.
All here.
:-)





He's talking about having an expression editor on the timer object. Something that I believe was discussed in the past?
yes yes :-)
expression editor inside a timer ... It would be perfect!












Oh, every as in the timer not as in the concept. You can make your own system in which you regularly increment the counter or global value and compare its value to n (see this topic). You can also give the Timer and Time X objects a try.
.:::.Joshtek.:::.
thanks Joshtek for a suggestion :-)
This are the solution for my problem:
____________________________________________
start of frame set COUNTER to 0
...
+ COUNTER >= framerate
+ CHECKBOX "repeatN" CHECKED
+ CHECKBOX "auto" CHECKED
set COUNTER to 0
START LOOP "s" 1 times
...
+ CHECKBOX "repeatN" CHECKED
+ CHECKBOX "auto" CHECKED
add to COUNTER simplecursorval+1/simplecursormaxval
____________________________________________
OR more compact
____________________________________________
+ COUNTER >= framerate
+ CHECKBOX "auto" CHECKED
set COUNTER to 0
START LOOP "s" 1 times
...
+ CHECKBOX "auto" CHECKED
add to COUNTER simplecursorval+1/simplecursormaxval
____________________________________________
:crazy: