Erratic visual effect on opening new stack

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Contact:

Erratic visual effect on opening new stack

Post by ctflatt » Sun Apr 17, 2011 11:18 am

I currently have a main stack that provides links to open other stacks on top of the main.

This functions as expected. However, applying visual effects to transition the opening of the new stack does not function as expected.

When the new stack opens it just appears, and the visual effect fires only after initiating a touch of the newly opened stack. This creates a jarring user experience.

I have reviewed my code and cannot figure out why this is happening.

In the main stack, I have a control with the following:

Code: Select all

on mouseUp
   visual effect flip left
   go to stack "newStack"
end mouseUp
This opens the new stack, but the flip left visual effect does not fire until the user taps the screen of the newly opened stack...

Am I missing something?

Thanks!

Todd

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Erratic visual effect on opening new stack

Post by Klaus » Sun Apr 17, 2011 11:28 am

Hi Todd,

visual effects do not work with stacks in the desktop version of LiveCode,
so it might be possible that this is also not supported on iOS.


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: Erratic visual effect on opening new stack

Post by bn » Sun Apr 17, 2011 12:52 pm

Hi Todd,

I tried with a stack and a substack of this stack in the Simulator and on an iPad.

Each stack had 1 card and on each card there was a button to go to the other stack.

When starting up the app in the Simulator the first time it was how you describe, going to the substack did not produce a visual effect. When I click the button on the substack the flip effect happened twice. From then on it worked as expected.

I changed the scipt of the first button in the first stack to:

Code: Select all

on mouseUp
   visual effect flip left
   go  stack "newStack"
   go this card
end mouseUp
This flipped the card of the substack, not from the Mainstack. So it is not correct, but probably the user will not notice. The subsequent times it flipped the card of the main stack to the card of the substack.
The button on the substack has this script:

Code: Select all

on mouseUp
   visual effect flip left
   go to stack "TransitionTest"
end mouseUp
This all looks like a bug to me, especially since it works after the first time as expected.

Kind regards

Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: Erratic visual effect on opening new stack

Post by bn » Sun Apr 17, 2011 3:28 pm

Hi Todd,

I think I found a solution:
set the script of the button of the first stack to:

Code: Select all

on mouseUp
   go invisible stack "newStack"
   visual effect flip left
   go stack "newStack"
end mouseUp
apparently by going to the second stack invisibly Livecode somehow renders the stack and then when you issue the second go stack the stack is ready for a visual effect.
Now it works as you would expect, the card of the first stack flips into the card of the second stack.

Kind regards

Bernd

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Contact:

Re: Erratic visual effect on opening new stack

Post by ctflatt » Mon Apr 18, 2011 11:27 pm

Bernd:

Once again, you're helping me through :)

I really appreciate it.

BTW, I'm beginning to think this is a bug, too, as I'm seeing the same behavior in the simulator when working in a single stack...

Should it be logged or at least questioned?

:Todd

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Contact:

Re: Erratic visual effect on opening new stack

Post by ctflatt » Tue Apr 19, 2011 11:16 am

Bernd:

It gets stranger... I was in the simulator this morning pondering why the flip effect was not firing on the first click even within the same stack. To my surprise, after about 45 seconds, the screen DID flip... it's like there is a built-in delay for the transition to happen. I haven't programmed it this way.

Could this be an issue with the simulator?

Can you replicate?

:Todd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: Erratic visual effect on opening new stack

Post by bn » Tue Apr 19, 2011 11:18 am

Hi Todd,

could you please specify: graphic effects to any extend, e.g. drop shadows, etc.?

Will try to replicate once I know the specifics.

Kind regards

Bernd

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Contact:

Re: Erratic visual effect on opening new stack

Post by ctflatt » Tue Apr 19, 2011 11:37 am

Bernd:

Am sending the stack to you...

Hope it helps.

:Todd

Post Reply