Page 1 of 1

browserimage on all pages

Posted: Tue Sep 08, 2009 6:22 pm
by AlexAdams
I have been working from the InetBrowser stack provided in the browser sampler. I got the provided stack modified to my liking. When I try to reproduce the card in another stack, the new card works fine, but the browserimage is appearing on all cards in the stack.

I don't have a clue as to why this is occurring.

Any ideas?

Thanks,

Posted: Tue Sep 08, 2009 8:06 pm
by Janschenkel
Hi Alex,

The 'browser' external control is a special and sometimes tricky pet to tame. In fact, what happens is that a browser is 'overlaid' on top of the stack window; but it doesn't know when you switch cards, that it should hdie itself, so that's your job; put something like this in the card script of the card where you want the browser to show:

Code: Select all

local sBrowserId

on openCard
  if sBrowserId is empty then
    put revBrowserOpen(the windowid of this stack, "about:blank") into sBrowserId
    -- finish setting up the rect etc.
  else
    revBrowserSet sBrowserId, "visible", "true"
  end if
end openCard

on closeCard
  if sBrowserId is not empty then
    revBrowserSet sBrowserId, "visible", "false"
  end if
end closeCard
This way, the first time the card is opened, the browser is setup and initialized; when you leave the card, it is hidden, and when you come back, it is shown once again.

HTH,

Jan Schenkel.

Thanks Jan

Posted: Tue Sep 08, 2009 9:44 pm
by AlexAdams
Thank you. That is what I needed to know.