Card transition slow for no apparent reason [solved]

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ledigimate
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 132
Joined: Mon Jan 14, 2013 3:37 pm

Card transition slow for no apparent reason [solved]

Post by Ledigimate » Wed Feb 05, 2014 10:32 pm

Hi gurus,

I've come across an inexplicable phenomenon: The transition between cards in my stack used to be fast, but all of sudden it's slowed down by 3 or more seconds for no apparent reason!
When I create a new main stack and copy the cards and scripts from the old stack to the new stack, the new stack's card transitions are fast like the old stack used to be. The new stack's file size is also 30% smaller than the old one. I don't understand how, because the the two stacks have exactly the same cards and scripts.
How can I prevent it from happening again? I would hate having to create a new stack every time. Please advise.

Thank you,

Gerrie
Last edited by Ledigimate on Mon Feb 10, 2014 5:44 pm, edited 1 time in total.
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Card transition slow for no apparent reason

Post by Simon » Wed Feb 05, 2014 10:46 pm

Hi Gerrie,
Something like this came up the other day, having to do with how the transition was called.
The new method is;
lock screen for visual effect
go cd 3 -- or hide/show/other
unlock screen with visual effect "push left"
But that does not explain file size change.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Ledigimate
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 132
Joined: Mon Jan 14, 2013 3:37 pm

Re: Card transition slow for no apparent reason

Post by Ledigimate » Mon Feb 10, 2014 5:43 pm

Hi all,

I have located the source of the problem.

My app is designed to dynamically create certain controls every time the window is resized. It deletes the previously created controls before creating the new ones, or so I thought. I observed that the card transition got longer with each resize, which then led me to believe that whatever's slowing down the transition, is also bloating the stack file size. I then reviewed the code that deletes the controls and here's what I found:

The dynamically created controls are cloned from template controls, and are then grouped. So far so good.
At the next resize, the previous group was deleted with the "remove group x from card y" command. Aha! That's what was causing the bloated stack size! I found out that I should have merely used the "delete group x of card y" command because the remove command doesn't remove the group from the stack; it only removes if from the card.

Silly me!

Gerrie
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101

Post Reply

Return to “Talking LiveCode”