browser script error help

Ken Ray kray at sonsothunder.com
Tue Nov 13 12:05:51 EST 2007


On Tue, 13 Nov 2007 15:26:54 -0000, Paul Robinson wrote:

> Is there a way to start the browser with the URL say google.com when the
> card loads? to avoid this error or is there something I don't understand
> yet?

Sure - here's what I've used:

(The browser is drawn in an image control called "browserimage"; and 
there's a group called "WebBar" that contains a field for the location 
("Location"), as well as a "Go" button) 

on preOpenCard
  -- We pass the windowId of the stack to revBrowser
  -- so that it can determine which window to place the
  -- browser object into
  put the windowid of this stack into tWinID
  
  -- Open the browser, using the windowId and initial url
  put revBrowserOpen(tWinID,"http://www.google.com") into sBrowserId
  set the uBrowserID of this stack to sBrowserID
  
  -- Set some basic properties for the browser
  revBrowserSet sBrowserId,"rect",rect of img "browserimage"
  revBrowserSet sBrowserId,"showborder","true"
  put "" into fld "Location"
  enable group "WebBar"
end preOpenCard

Hope this helps,

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list