Page 1 of 3

same code different result

Posted: Sun Feb 06, 2022 2:33 pm
by Samuele
Hi, I was starting to use the animation engine in my stack when this problem appeared, i use the same code to move two objects in a card but 1 is "glitched" meaning is not moving well, with glitches on the way and the other totally normally, the strange thing is that in the beginning the "glitched! one was moving normally then i changed the image resolution and since then it's glitched, even after I have returned the resolution to the one it was before :shock: Any ideas on how this occurred? Thanks!
P.S i leave here an example stack.
Menu.zip
(51.08 KiB) Downloaded 141 times

Re: same code different result

Posted: Sun Feb 06, 2022 5:02 pm
by dunbarx
Samuele.

Opened your stack and hit the button. The yellow thing moves smoothly. What is it you wanted to demonstrate?

Craig

Re: same code different result

Posted: Sun Feb 06, 2022 6:51 pm
by richmond62
Nothing obviously wrong.

However I could not resist the temptation to rewrite the functionality so you do not need the animation engine:

:twisted:
-
SShot 2022-02-06 at 19.48.48.png

Re: same code different result

Posted: Sun Feb 06, 2022 7:28 pm
by jacque
LC may be caching the image when the stack opens. Try closing and removing it from memory, and then open it again. See if that fixes it.

Re: same code different result

Posted: Sun Feb 06, 2022 7:50 pm
by richmond62
Exactly what Jacque says.

Be careful NOT to choose CLOSE but choose CLOSE and REMOVE:
-
closeNremove.png
closeNremove.png (54.76 KiB) Viewed 6870 times
-
AND try and see if the same problem arises with my version . . . 8)

Different code same result
:wink:

Re: same code different result

Posted: Sun Feb 06, 2022 9:51 pm
by Samuele
jacque wrote:
Sun Feb 06, 2022 7:28 pm
LC may be caching the image when the stack opens. Try closing and removing it from memory, and then open it again. See if that fixes it.
ahh, so send it to myself and then download it?

Re: same code different result

Posted: Sun Feb 06, 2022 10:19 pm
by Samuele
richmond62 wrote:
Sun Feb 06, 2022 7:50 pm
AND try and see if the same problem arises with my version . . .
yep, so that's the proof that the problem is on the images and not the script...

Re: same code different result

Posted: Sun Feb 06, 2022 11:09 pm
by jacque
Samuele wrote:
Sun Feb 06, 2022 9:51 pm
jacque wrote:
Sun Feb 06, 2022 7:28 pm
LC may be caching the image when the stack opens. Try closing and removing it from memory, and then open it again. See if that fixes it.
ahh, so send it to myself and then download it?
You don't need to do that. Just choose "Close and remove from memory" from the File menu. That will eliminate the cache. Then choose Open Stack to open your file again.

Or you can accomplish the same thing by just restarting LC.

Re: same code different result

Posted: Mon Feb 07, 2022 1:57 am
by stam
I must say, i never really understood why LC will 'close' files but keep them open in memory. There must be a use-case for this, but none that affects me, so i have set my preferences to always close file (even if destroyStack is false) and to assign destroyStack to true for all new stacks, so closing them removes the from memory as well.
Can be quite confusing occasionally otherwise!

Re: same code different result

Posted: Mon Feb 07, 2022 10:28 am
by richmond62
yep, so that's the proof that the problem is on the images and not the script...
Well, either I'm very stupid (don't answer that one), or there's some sort of communication breakdown,
because:

1. I can see nothing wrong with the functionality of your stack.

[I can see something wrong with the affordances, and will write about those later]

2. I cannot exactly understand what you mean by your problem.

If you could make a quick on-screen movie of the problem that would be super.

Re: same code different result

Posted: Mon Feb 07, 2022 11:03 am
by richmond62

Re: same code different result

Posted: Mon Feb 07, 2022 12:18 pm
by Samuele
jacque wrote:
Sun Feb 06, 2022 11:09 pm
Samuele wrote:
Sun Feb 06, 2022 9:51 pm
jacque wrote:
Sun Feb 06, 2022 7:28 pm
LC may be caching the image when the stack opens. Try closing and removing it from memory, and then open it again. See if that fixes it.
ahh, so send it to myself and then download it?
You don't need to do that. Just choose "Close and remove from memory" from the File menu. That will eliminate the cache. Then choose Open Stack to open your file again.

Or you can accomplish the same thing by just restarting LC.
ahhh, i restarted LC like a million times and tried your way as well, with no success...

Re: same code different result

Posted: Mon Feb 07, 2022 12:24 pm
by richmond62

Re: same code different result

Posted: Mon Feb 07, 2022 12:31 pm
by Samuele
richmond62 wrote:
Mon Feb 07, 2022 11:03 am
Affordances:

https://en.wikipedia.org/wiki/Don_Norman
-
SShot 2022-02-07 at 11.55.58.png
-
SShot 2022-02-07 at 12.01.10.png
alright, i know I'm a bit color blind and now i know I'm also not particularly smart, but what difference does it make if you understood? :wink:
Just kidding here, that's the video, i hope it'll be clearer than my words :) https://www.dropbox.com/t/z6dHsrfOOXJqxKhl

Re: same code different result

Posted: Mon Feb 07, 2022 12:32 pm
by Samuele
richmond62 wrote:
Mon Feb 07, 2022 12:24 pm
Try your stack with another version of LiveCode:

https://archive.org/details/live-code-c ... ws-x86-x64

https://archive.org/details/live-code-c ... taller-mac
i already have have 2 versions on my pc, LC community 9.5 and 9.6.3