Button do not navigate

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
genie
Posts: 108
Joined: Thu Dec 01, 2011 7:19 am

Button do not navigate

Post by genie » Fri Sep 13, 2013 8:33 am

Hello!

I have this weird problem.... my buttons do not go to another card when tapped. Works perfectly on iOS. Problem only exist when deployed to Android.

Button script:

Code: Select all

on mouseUp
   answer "tapped"
   go to card "About"
end mouseUp
I know that button is tapped because the toast message appears. But it stops there.

I know that it never got into card "About" because the toast inside preOpenCard never appears.

Card "About" script:

Code: Select all

on preOpenCard
   answer "on card about"
   pass preOpenCard
end preOpenCard
Problem sounds silly, but I am hoping somebody else experienced this too. Anyone?

Will really appreciate any feedback.


Thanks,
Genie

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: Button do not navigate

Post by AndyP » Fri Sep 13, 2013 1:48 pm

Hi Genie,

Try with on OpenCard instead of on preOpenCard.

With on preOpenCard the card and all objects associated with it are not visible so you will not see the Answer dialogue.

on OpenCard
answer "on card about"
pass OpenCard
end OpenCard
Andy .... LC CLASSIC ROCKS!

genie
Posts: 108
Joined: Thu Dec 01, 2011 7:19 am

Re: Button do not navigate

Post by genie » Sat Sep 14, 2013 12:01 am

Thanks Andy!

I tried, but still didn't work.

Also, the UI really didn't go to card "About". Stays on the same screen. :(

athelene
Posts: 18
Joined: Sun Jul 26, 2015 9:19 pm

Re: Button do not navigate

Post by athelene » Mon Sep 07, 2015 11:23 pm

I'm having the same problem described above. Any further suggestions on how to troubleshoot? My situation is that I have a button with the following code. When it's clicked on, nothing happens.

on mouseUp
go to card "cardEditCategories"
end mouseUp

Athelene

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Button do not navigate

Post by dave.kilroy » Mon Sep 07, 2015 11:45 pm

hi Athlene & Genie - here is my list of irritating questions, maybe one of them will remind you of something that will lead you to the solution - got any frontscripts in your stacks? Or behaviors with 'before' handlers? what version of LiveCode are you using? what Android SDK are you applying? could it be a bug in LiveCode? do you get the same results with emulator as on real devices? what happens if you have another button that sends a 'mouseup' message to the problem button? if you create a new button with the same script does this work? if you create a 'hello world' app for android does this also have wonky buttons?

And finally, Athlene what happens if you make the button a bit bigger for your Android builds?
"...this is not the code you are looking for..."

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Button do not navigate

Post by Dixie » Mon Sep 07, 2015 11:49 pm

Mmm... strange, but maybe this might help... this allows the card to finish opening before you get it to do anything else

Code: Select all

on openCard
   send "goAbout" to this card in 20 millisecs
end openCard

on goAbout
   go card "about"
end goAbout

athelene
Posts: 18
Joined: Sun Jul 26, 2015 9:19 pm

Re: Button do not navigate

Post by athelene » Wed Sep 09, 2015 9:39 pm

Dave, thank you for the reply. To start, I haven't even tried in an emulator yet. It's not working in the IDE. Building as a standalone, not Android (yet.) I have some onLoad handlers for the two cards in the app (pretty simple app so far!) Using LiveCode 7.0.6 build 10038. I will try to create another button to test. I'll report back once I get a chance to do so. Thanks again for the troubleshooting ideas.

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

Re: Button do not navigate

Post by Simon » Wed Sep 09, 2015 9:57 pm

Hi Genie,
Is that "answer "tapped"" in the script while running on an Android?
That may through it off, try running it without the "answer".

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

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Button do not navigate

Post by sturgis » Thu Sep 10, 2015 5:40 pm

Are you sure you have a card named "about?"

Right after you try to go to the card, put this..

answer the result

If there is a problem when you try to go to the card it will appear in "the result" for example, if I try to go to a card that doesn't exist, the result contains "No such card". Hopefully if there is something wonky going on, you'll be able to figure it out using the result.

Post Reply