Why do gif's always go bad in my apps..?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Why do gif's always go bad in my apps..?
Hi there,
I always seem to have problems with gif image spinners in my apps.
So for example, i have a gif spinner image with the visible set to false.
Then set the visible to true breifly during some process.
At first the spinner always works and spins correctly. But at some point after using the app over time, the image always becomes stuck on on frame, and thus shows but no longer spins.
How are my apps always breaking my animated gif images..?
I always seem to have problems with gif image spinners in my apps.
So for example, i have a gif spinner image with the visible set to false.
Then set the visible to true breifly during some process.
At first the spinner always works and spins correctly. But at some point after using the app over time, the image always becomes stuck on on frame, and thus shows but no longer spins.
How are my apps always breaking my animated gif images..?
Kind Regards
Gary
https://www.doobox.co.uk
Gary
https://www.doobox.co.uk
Re: Why do gif's always go bad in my apps..?
Look at repeatcount in the dictionary. SPecifically setting the repeatcount to a negative number.
Re: Why do gif's always go bad in my apps..?
Thank you..
I was not to sure what that repeat was in the inspector for the image, but do recall it set to -1
Just checked, and it was set to 1
It looks like importing a new spinner, sets the repeat to -1 by default, but somewhere along the line it gets switched to 1
I will keep an eye on it.
Do you think setting the repeat count of the image via script could make a difference..?
I was not to sure what that repeat was in the inspector for the image, but do recall it set to -1
Just checked, and it was set to 1
It looks like importing a new spinner, sets the repeat to -1 by default, but somewhere along the line it gets switched to 1
I will keep an eye on it.
Do you think setting the repeat count of the image via script could make a difference..?
Kind Regards
Gary
https://www.doobox.co.uk
Gary
https://www.doobox.co.uk
Re: Why do gif's always go bad in my apps..?
it might. If it is ending up set at one it will basically go through the images a single time and stop. Not sure why it would change to 1 from -1 but manually setting it when you make the image visible isn't a bad idea. Animated gifs eat cpu so if it were me I'd set it to 0 when invisible and -1 when visible so that its only animated when you want it to be. You can also set the framecount to 1 to start at the beginning again.
Re: Why do gif's always go bad in my apps..?
Year, that sound like a good idea. It will both ensure i get proper animation as well as saving cpu as you point out.
Thanks again (great i now understand how LC handles gifs)
Thanks again (great i now understand how LC handles gifs)

Kind Regards
Gary
https://www.doobox.co.uk
Gary
https://www.doobox.co.uk
Re: Why do gif's always go bad in my apps..?
You should be able to set the gif to -1 and leave it that way. I don't think the engine draws it when it isn't visible so it won't use any of the CPU.
If you are in a long process then the engine will be too occupied to draw the frames. That can happen especially in repeat loops. Add this inside the loop to give the engine time to update the gif:
If you are in a long process then the engine will be too occupied to draw the frames. That can happen especially in repeat loops. Add this inside the loop to give the engine time to update the gif:
Code: Select all
wait 1 millisecond with messages
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Why do gif's always go bad in my apps..?
Ah k. Wasn't sure if it was still flipping through frames when it was invisible. Even if it is, not having to draw them would still be the main benefit. Thx for the clarification!