Problem with mobile scroller
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Problem with mobile scroller
Hi forum,
I have a problem with a mobile scroller. It basically works, but when switching from one stack to another, the following happens:
- open the app
- press "goto stack2" -----> scroller works
- go back to stack1
- press "goto stack3" ------> scroller works
- go back to stack1
- press "goto stack2" again -----> scroller doesn't work anymore
The app is attached. I wonder, why it works only once.
LC version: Windows, LC9 (rc2)
Android: 8.0.0
Thank you
Walter
I have a problem with a mobile scroller. It basically works, but when switching from one stack to another, the following happens:
- open the app
- press "goto stack2" -----> scroller works
- go back to stack1
- press "goto stack3" ------> scroller works
- go back to stack1
- press "goto stack2" again -----> scroller doesn't work anymore
The app is attached. I wonder, why it works only once.
LC version: Windows, LC9 (rc2)
Android: 8.0.0
Thank you
Walter
- Attachments
-
- test-scroll.rar
- (2 KiB) Downloaded 191 times
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: Problem with mobile scroller
I think you're better off sending a livecode file in a standard .zip format instead of .rar
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
Re: Problem with mobile scroller
At your services, Sire!
- Attachments
-
- test-scroll.livecode.zip
- (2.53 KiB) Downloaded 171 times
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: Problem with mobile scroller
There's a typo in both of the cards scripts. ssScrollerID should be sScrollerID
Also I believe your vars should be local and not global. More importantly, why are you using sub-stacks instead of cards on mobile?
should be
Also I believe your vars should be local and not global. More importantly, why are you using sub-stacks instead of cards on mobile?
Code: Select all
put the result into ssScrollerID
Code: Select all
put the result into sScrollerID
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
Re: Problem with mobile scroller
Thank you for your reply.
I have corrected the typo, I also use local instead of global variables now, but still no luck.
Corrected app is attached (.zip this time).
It still puzzles me that it works 1 time at program start, from the second time on it doesn't.
Tom:
Thank you for your help.
Walter
I have corrected the typo, I also use local instead of global variables now, but still no luck.
Corrected app is attached (.zip this time).
It still puzzles me that it works 1 time at program start, from the second time on it doesn't.
Tom:
I use different stacks in a bigger project, in this example I just wanted to match the same conditions as in the big app, just in case if my problem has something to do with it.More importantly, why are you using sub-stacks instead of cards on mobile?
Thank you for your help.
Walter
- Attachments
-
- test-scroll.zip
- (2.08 KiB) Downloaded 181 times
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Problem with mobile scroller
I haven't actually looked at the stack, but a common problem is that scrollers aren't deleted when leaving the card. Native controls stay on top of everything, they aren't linked to a single card or control, so it's a good idea to destroy them on closecard and recreate them on preopencard or opencard. Otherwise residual scrollers can interfere with each other.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with mobile scroller
Hi Jacqueline,
Thank you for your reply.
Yes, I do destroy the scroller on closeCard:
There must something happen when jumping from one stack to another.
Cheers
Walter
Thank you for your reply.
Yes, I do destroy the scroller on closeCard:
Code: Select all
on closeCard
// Delete the scroller
if environment() is not "mobile" then exit closeCard
mobileControlDelete sScrollerID
end closeCard
Cheers
Walter
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Problem with mobile scroller
Okay, so that's not it. Anoather thing may be that the scroller isn't aligned with the LC field. When I create a new scroller I set the scroll of the LC field to zero, create the scroller, and then adjust both scrolls if necessary. If that's not it then I'm out of ideas.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with mobile scroller
Hi Jacqueline,
Could you do me a favour and try the app? I really would be interested if you are able to reproduce the problem, so that I could rule out that it is a failure on my system - at least.
Do the following steps:
- open the app
- press "goto stack2" -----> scroller works
- go back to stack1
- press "goto stack3" ------> scroller works
- go back to stack1
- press "goto stack2" again -----> scroller doesn't work anymore
Thank you
Walter
Could you do me a favour and try the app? I really would be interested if you are able to reproduce the problem, so that I could rule out that it is a failure on my system - at least.
Do the following steps:
- open the app
- press "goto stack2" -----> scroller works
- go back to stack1
- press "goto stack3" ------> scroller works
- go back to stack1
- press "goto stack2" again -----> scroller doesn't work anymore
Thank you
Walter
Re: Problem with mobile scroller
You know, for jacque, asking to download a stack is about as tasteful as asking her to lick a fire hydrant.
So I checked it out for her (no I didn't lick anything!)
You are moving from one stack to another, and in the closeCard script you are destroying the scroller.
But
You can workaround in the navigation button script by adding a line(or close stack "stack3" of course). I am sure there are neater ways than that though, and you might introduce other problems with possible closeStack handlers that fire.
As jwack advised above, in general you should also reset the vScroll of the LiveCode objects (in the preOpenCard handler where you create the new mobile scoller) to match the vScroll of the newly created mobile scroller so they sync:
So I checked it out for her (no I didn't lick anything!)
You are moving from one stack to another, and in the closeCard script you are destroying the scroller.
But
When you are navigating back to stack 1, you are not closing the substacks, so the closeCard handler never gets triggered.Under closeCard, the LC dictionary wrote:A card is closed when the user either goes to another card in the same stack, or closes the stack.
You can workaround in the navigation button script by adding a line
Code: Select all
on mouseUp pMouseButton
go to card "a1" of stack "stack1"
close stack "stack2"
end mouseUp
As jwack advised above, in general you should also reset the vScroll of the LiveCode objects (in the preOpenCard handler where you create the new mobile scoller) to match the vScroll of the newly created mobile scroller so they sync:
Code: Select all
//set the vScroll of the LC objects so they sync
set the vScroll of group "scrollArea" to 0
set the vScroll of field "Field" of group "scrollArea" to 0
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Problem with mobile scroller
Thanks for testing, SparkOut. It wasn't distasteful to ask me to test (I do have a fire hydrant on our corner, after all) but it would take some time to download and set up a test and I need to find a gap in my schedule to do that, so it would take longer. I usually read the forums on my tablet over coffee in the morning where I'm not near the computer.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with mobile scroller
I shouldn't have suggested that, I know you don't get to download things normally (I too almost always read the forum on my phone). I was going for a bit of humour. Rereading I realise that I imply you mistrust the request and don't want to help. Nothing could be further from the truth and I apologise.
I could have said "getting jacque in a situation where she can download and test it is about as likely as a situation where she would lick a fire hydrant". But really I should not have gone for anything like that, it still implies some sort of faling or reluctance on your part. I'd have been better just to have said "I'll save jacque the trouble..."
I could have said "getting jacque in a situation where she can download and test it is about as likely as a situation where she would lick a fire hydrant". But really I should not have gone for anything like that, it still implies some sort of faling or reluctance on your part. I'd have been better just to have said "I'll save jacque the trouble..."
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Problem with mobile scroller
Oh, not at all! I actually laughed, it was funny. And I really DO have a fire hydrant outside.
Nothing to apologize for at all. I appreciate your help, and if anything, my own response wasn't clear enough. I should have added smileys.
Nothing to apologize for at all. I appreciate your help, and if anything, my own response wasn't clear enough. I should have added smileys.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with mobile scroller
I'm not sure warm dog urine tastes any better!