Browser group won't disappear !

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
michel_bujardet
Posts: 45
Joined: Mon Apr 21, 2014 10:41 am
Contact:

Browser group won't disappear !

Post by michel_bujardet » Fri May 02, 2014 2:23 am

I have built the browser example described at http://lessons.runrev.com/s/lessons/m/4 ... er-control
It works fine, but when I try to go to another card, the browser area (group "Browser") sticks to the screen. The card changes (I can see the new card behind), but the browser area stays over.

I tried to set the visible of group "Browser" to False, but it does nothing.

Searched this forum but could not find mention of this problem.

How can I get rid of the browser when I move to another card ?

Thank you.

Mitch
http://FontMenu.com

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

Re: Browser group won't disappear !

Post by Dixie » Fri May 02, 2014 2:42 am

You have two choices here...
1. You can destroy the browser instance as you leave the card

Code: Select all

mobileControlDelete theBrowserID
2. Just hide it, if you just want to build it the one time and use it again when you come back to the card on which it displays

Code: Select all

mobileControlSet theBrowserID, "visible", "false"

michel_bujardet
Posts: 45
Joined: Mon Apr 21, 2014 10:41 am
Contact:

Re: Browser group won't disappear !

Post by michel_bujardet » Fri May 02, 2014 9:11 am

Dixie wrote:You have two choices here...
1. You can destroy the browser instance as you leave the card

Code: Select all

mobileControlDelete theBrowserID
2. Just hide it, if you just want to build it the one time and use it again when you come back to the card on which it displays

Code: Select all

mobileControlSet theBrowserID, "visible", "false"
Thank you Dixie.

Amazingly enough, the delete command was already there but somehow the variable "sBrowserId" that is supposed to keep the browser ID from its creation in PreOpenCard is not accessible from the other handlers. It was declared as

Code: Select all

Local sBrowerId
on top of the card script. I tried

Code: Select all

Global sBrowserId
but still sBrowserId seems valid only in PreOpenCard. I have replaced it by its ID (1) and the hide or delete work, but the browser does not show the second time the card is displayed.

Now I have to figure out what is going on.

Mitch
http://FontMenu.com

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

Re: Browser group won't disappear !

Post by Dixie » Fri May 02, 2014 9:37 am

I have posted a stack...
It has two cards, the browser is built the first time you go to the second card
You can then move between the two cards and the browser will be hidden or shown, depending if you are on the first or second card
The handlers are in the card script of the second card...

hope it helps...:-)
Attachments
hideBrowser.livecode.zip
(2.01 KiB) Downloaded 191 times

michel_bujardet
Posts: 45
Joined: Mon Apr 21, 2014 10:41 am
Contact:

Re: Browser group won't disappear !

Post by michel_bujardet » Fri May 02, 2014 12:29 pm

Dixie wrote:I have posted a stack...
It has two cards, the browser is built the first time you go to the second card
You can then move between the two cards and the browser will be hidden or shown, depending if you are on the first or second card
The handlers are in the card script of the second card...

hope it helps...:-)
Thank you so much Dixie. You are great :)

Mitch
http://FontMenu.com

Post Reply