Code: Select all
Put URL "http://www.google.com" into field "field"
Moderators: LCNeil, heatherlaine, kevinmiller, elanorb
Code: Select all
Put URL "http://www.google.com" into field "field"
Code: Select all
if the environment is "mobile" then
# use the mobile browser commands
else
# use the revBrowser commands
end if
Code: Select all
local tBrowser -- browser object
local tMobileBrowser -- mobile browser object
on startBrowser
if the environment is "mobile" then
mobileControlCreate "browser" -- creates a new browser window on current card
put the result into tMobileBrowser
mobileControlSet tMobileBrowser, "rect", the rect of this card
mobileControlSet tMobileBrowser, "visible", "true"
mobileControlSet tMobileBrowser, "url", tData[tPos]["location"]
else
put revBrowserOpen(the windowId of this stack, tData[tPos]["location"]) into tBrowser
if tBrowser is not an integer then
answer "Failed to open browser"
end if
revBrowserSet tBrowser, "showborder", true
revBrowserSet tBrowser, "visible", true
revBrowserSet tBrowser, "rect", rect of this card
end if
end startBrowser
on stopBrowser
if the environment is "mobile" then
mobileControlDelete tMobileBrowser
else
if tBrowser is not empty then
revBrowserClose tBrowser
end if
end if
end stopBrowser
on resizeBrowser
if the environment is "mobile" then
mobileControlSet tMobileBrowser, "rect", the rect of this card
else
if tBrowser is not empty then
revBrowserSet tBrowser, "rect", rect of this card
end if
end if
end resizeBrowser