LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
On mobile, (LC 9.6.2 indy) I need to do a visual effect transition going from one substack to another substack.
I found this method on the forum (viewtopic.php?t=6927)
put "Card" && quote & "Main" & quote && "of stack" && quote & tStack & quote into gCDmain
lock messages
go gCDmain in the window of this stack
unlock messages
Everything works except that after this code the standalone becomes unresponsive, at least for a little while(?!)
Like, buttons don't do any action anymore, but no error messages of any sort.
On the development environment everything works fine. But being on Indy I cannot check what is going on the mobile hardware.
Any suggestion?
go cd "Main" of stack "another stack" in window of this stack
I would set a GLOBAL variable or custom property and check it in the "pre-/openstack" handlers of your (sub-)stacks.
Obviously the "lock messages" is making problems.
On mobile, (LC 9.6.2 indy) I need to do a visual effect transition going
Taking off the "lock messages" does not solve my problem.
Must be something else that is difficult for me to pin, without having a mobile debugger.
Ayway, I attach a demo stack that at least works fine, for other to use.
global do_not_execute_preopenstack
on preopenstack
if do_not_execute_preopenstack then
exit preopenstack
end if
## more stuff to do
## ...
end preopenstack
...
global do_not_execute_preopenstack
put TRUE into do_not_execute_preopenstack
lock screen for visual effect
go cd "Main" of stack "another stack" in window of this stack
unlock screen with visual dissolve
...
Yes, this is what I did, putting a flag and so on.(good suggestion)
The preopenstack now does not run if I need not to.
But this was not the problem.
When I am going from substack B to substack A, with the "open in window" etc, everything is fine.
In the the substack A then everything works.
BUT if thenI try to go back to substack B, the screen does not change(it stay sub A) but the clicking response like if i were in sub B.
Note: as i said, only on mobile. On the OSX is fine.
Got the idea?
Thanks for the help
...
lock screen for visual effect
go cd "Main" of stack "A" in window of this stack
unlock screen with visual dissolve
close stack "B" --the stack i was coming from
...
After this, clicking on cd "Main", which is correctly shown, is like clicking on the buttons of the substack I was coming from ("B", which by the way I closed at the end of the script)!!!
Is there a command to be added to the the end of the script above, so that the stack "A" is in its window and respond correctly to user interaction?
I tried "set the default stack to..." to no avail.
Should I run at the end of the script another go cd "main" of stack "A" in Windows of this stack (uh!)
This is very confusing
on mouseUp
lock screen for visual effect
go stack "yyy" in window of this stack
unlock screen with visual dissolve
close stack "xxx" --the stack i was coming from
end mouseUp
Works fine.
If you are navigating "in window" you do not need to close the "starting" stack. LC is being told to work within a single window.
Also, I did not see the visual effect. Navigation to another stack did not seem to work, whereas going to another card in the same stack certainly does. So you may not need three of the lines in your handler. But the dictionary states that it should.
I did a test stack (see attachment) and I found the followings:
- doing a search on the dictionary about "purge" doesn't bring any result (purge stack and purge window probably deserve some clarification)
- On the development environment, on the test stack, once back to substack "sub1" from "sub2", you need to press twice the central button in order to go back to "Sub2". UNLESS you move slightly the pointer (?). That is, if you carefully don't move the mouse, the first click doesn't bring any action
- on the iOS simulator the above doesn't apply
- I cannot reproduce my problem on mobile, when I see a substack but clicks do action on the stack I was before (like if it was not refreshed). Mobile only.
- going to stack "in window", always close the stack where you come from, while going simply to stack, as in the example, leaves "Sub1" opened (as it should)
Can someone explain how this "in window" works?
Thanks
For what i know it is the only way to apply visual effect to transition between stacks (no,I can't use cards since my app is big enough to be spread across at least 15 substacks).
Are you saying, forget visual effect, like sliding from screen to screen?
Unfortunately I have to apply transitions also between substack, in order to give the user a logic of its navigation in the App, that is become more and more complex.