Refresh rate = frames or?

I believe if you have something like

if (loop.posistion = .963){
trace(“HI”)

You will probably never see the trace because the if statement only refreshes at the rate of your current fps.

What about action loops?

for (i=0; i<10000; i++){
listbox.additem(HI + i)

What rate do they work at. Do they go as fast as the computer will / Flash, or do they also refresh at the fps rate?

fps
if you have onClipEvent(enterFrame {}
that will be fps too…

Loops are executed within the frame, whatever happens. So basically as fast as your processor can. I don’t know how many calculation the average processor can take, but probably no more than a few thousands. When you go beyond that, it will start lagging (to do all the calculations you asked him to do) and eventually drop frames.

pom :asian:

oh…
:cyclops:

So,

if (loop.posistion == .963){
trace(“HI”)

refreshes at fps rate and,

for (i=0; i<10000; i++){
listbox.additem(HI + i)

refreshes at the speed of your computer?

If this is the case how could I put

if (loop.posistion == .963){
trace(“HI”)

into a loop function

My reasoning is I would like to use the faster refresh time, so flash will be able to see “loop.position == .963.” At the current refresh rate = my fps, the “if function” is not fast enough.

Nope the loop doesn’t refresh the way you’d expect it to refresh. This is definitely not a good idea. You’d better try instead to approximate that value.

pom :cowboy:

OK, if I’m stuck with the approximant value, is there a way to speed the refresh rate up so the approximant value can be small. If I use a higher fps the refresh will increase but so will the rest of my movie. Is there a way to increase the fps of my if function movie clip without increasing the fps of my main movie.

Why don’t you check if it is superior to 0.963? That way you don’t have to approximate anything.

pom :slight_smile:

I don’t know what you mean by “check if it is superior to 0.963?”,
but this is what I tried.

if (_root.lp.position/1000==.963){
trace(“HI”)}

The trace never happens. About as close as I can get with it missing every once and a while is

(_root.lp.position/1000>=.0 && _root.lp.position/1000<=.05){
trace(“HI”)}

I would like it to be flawless, of course so close, but so far away.

:*(

if (_root.lp.position/1000>=.963){
   trace("HI");
}

It this is not doing what you want, well, post a fla, hopefully someone can have a look at it.

pom :slight_smile: