Page 1 of 1
Mobile browser
Posted: Thu Feb 13, 2014 8:02 am
by saviour
I will appreciate if someone could guide me on this:
mobileControlCreate "browser"
put the result into sBrowserId
mobileControlSet sBrowserId, "visible", "true"
mobileControlSet sBrowserId, "load", the yURL of this cd
resizeStack
end preOpenCard
But link do not open in the browser area. So where am I wrong here? Please help!!!!
Re: Mobile browser
Posted: Thu Feb 13, 2014 8:12 am
by Simon
Hi saviour,
I think for you the best thing would be to make a global variable.
Code: Select all
global yURL
on mouseUp
put "http://www.google.com" into yURL
go to card "card2"
end mouseUp
Then on card 2
Code: Select all
global yURL
local sBrowserId
on preOpenCard
if the environment is not "mobile" then
exit preOpenCard
end if
mobileControlCreate "browser"
put the result into sBrowserId
mobileControlSet sBrowserId, "visible", "true"
mobileControlSet sBrowserId, "load", the yURL of this cd
resizeStack
end preOpenCard
Not sure but I think you have to set the rect of sBrowserId as well which is missing.
Simon
Re: Mobile browser
Posted: Thu Feb 13, 2014 1:23 pm
by Klaus
Hi all,
the ORDER of the commands is highly important!
This:
Code: Select all
on mouseUp
go to card "card2"
set the yURL of card "card2" to ".................."
end mouseUp
will go cause "pre-/opencard" will be executed BEFORE the cp has been set!
So this (and setting the RECT of the mobile brower!) should do the job:
Code: Select all
on mouseUp
set the yURL of card "card2" to ".................."
go to card "card2"
end mouseUp
@Simon
when using a global you should use it everywhere:
Code: Select all
global yURL
...
## mobileControlSet sBrowserId, "load", the yURL of this cd
mobileControlSet sBrowserId, "load", yURL
...
Best
Klaus
Re: Mobile browser
Posted: Thu Feb 13, 2014 5:36 pm
by saviour
Thanks guys!! Tested it and it really worked on my Android device..
I have learnt many things from u..Appreciate that
