Browsing field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Browsing field
Hello, I have created a field on my stack and I trying to fill it with a webpage from the internet.
I have tried anything to bring the webpage to show it in that field I created but nothing it is working.
Anybody can help me? I am sure that probably the solution is pretty easy but I am new at this.
I am using this on a button:
on mouseUp
put URL "http://www.abc.net/" into Field "WebField"
end mouseUp
But the field does not resolve the URL, only giving me the html source code!!
Thank you
Herman
I have tried anything to bring the webpage to show it in that field I created but nothing it is working.
Anybody can help me? I am sure that probably the solution is pretty easy but I am new at this.
I am using this on a button:
on mouseUp
put URL "http://www.abc.net/" into Field "WebField"
end mouseUp
But the field does not resolve the URL, only giving me the html source code!!
Thank you
Herman
Re: Browsing field
You will probably want to look at the revBrowser features, but here is a quickie script
1. create an image control, call it "browserRect", set the dimensions to whatever you want
2. create a button, add this script
3. ???
4. profit
1. create an image control, call it "browserRect", set the dimensions to whatever you want
2. create a button, add this script
Code: Select all
on mouseUp
local tBrowserID
put revBrowserOpen(the windowID of this stack, "http://www.abc.net/") into tBrowserID // creates a revBrowser instance and navigates to the website
revBrowserSet tBrowserID, "rect", (the rect of image "browserRect") // sets the dimensions of the browser instance to the dimensions of the image
end mouseUp
4. profit
Re: Browsing field
THANK YOU!!!!!!!!shaosean wrote:You will probably want to look at the revBrowser features, but here is a quickie script
1. create an image control, call it "browserRect", set the dimensions to whatever you want
2. create a button, add this script
3. ???Code: Select all
on mouseUp local tBrowserID put revBrowserOpen(the windowID of this stack, "http://www.abc.net/") into tBrowserID // creates a revBrowser instance and navigates to the website revBrowserSet tBrowserID, "rect", (the rect of image "browserRect") // sets the dimensions of the browser instance to the dimensions of the image end mouseUp
4. profit
This was exactly what I wanted!
I never knew about this revBrowser I have to study the dictionary. I am new to all this.
Again, thank you!!
Herman
Re: Browsing field
I have successfully created a button to launch the website but what about if I want the website to automatically open when stack open? I have tried the same code with " On preopenstack" and "end preopenstack without success. What am I doing wrong?shaosean wrote:You will probably want to look at the revBrowser features, but here is a quickie script
1. create an image control, call it "browserRect", set the dimensions to whatever you want
2. create a button, add this script
3. ???Code: Select all
on mouseUp local tBrowserID put revBrowserOpen(the windowID of this stack, "http://www.abc.net/") into tBrowserID // creates a revBrowser instance and navigates to the website revBrowserSet tBrowserID, "rect", (the rect of image "browserRect") // sets the dimensions of the browser instance to the dimensions of the image end mouseUp
4. profit
Thanks
Herman
Re: Browsing field
preOpenStack is too early, try moving it to either the preOpenCard (might still be too early) or openCard
Re: Browsing field
Already tried without luck!shaosean wrote:preOpenStack is too early, try moving it to either the preOpenCard (might still be too early) or openCard
What could it be?
Herman
Re: Browsing field
Might be due to the way the revBrowser external works, so lets try this in your stack/card script
Code: Select all
on preOpenStack
send "makeBrowserWork" to me in 0 seconds // this causes the message to be put at the end of the queue
end preOpenStack
on makeBrowserWork
local tBrowserID
put revBrowserOpen(the windowID of this stack, "http://www.abc.net/") into tBrowserID // creates a revBrowser instance and navigates to the website
revBrowserSet tBrowserID, "rect", (the rect of image "browserRect") // sets the dimensions of the browser instance to the dimensions of the image
end makeBrowserWork
Re: Browsing field
It works!!! I was inserting the code in the wrong stack.shaosean wrote:Might be due to the way the revBrowser external works, so lets try this in your stack/card script
Code: Select all
on preOpenStack send "makeBrowserWork" to me in 0 seconds // this causes the message to be put at the end of the queue end preOpenStack on makeBrowserWork local tBrowserID put revBrowserOpen(the windowID of this stack, "http://www.abc.net/") into tBrowserID // creates a revBrowser instance and navigates to the website revBrowserSet tBrowserID, "rect", (the rect of image "browserRect") // sets the dimensions of the browser instance to the dimensions of the image end makeBrowserWork
THANK YOU SOO MUCH!! if you were in Brisbane, Australia I will invite you to a few drinks on me!
Thanks mate!
Herman
Re: Browsing field
Hello, I am having problems with this code:
I am getting a
Wy is this happening
Code: Select all
on mouseUp
put empty into field "result"
put field "URL" into tlocation
local tBrowserID
-- creates a revBrowser instance and navigates to the website
put revBrowserOpen(the windowID of this stack, tlocation) into tBrowserID
-- sets the dimensions of the browser instance to the dimensions of the image
revBrowserSet tBrowserID, "rect", (the rect of image "browserRect")
end mouseUp
or aNavigation to the webpage was canceled
note in the field, instead of the contents of the field.This program cannot display the webpage
Wy is this happening

Re: Browsing field
Sorry, it was my antivirus (it was set on a property that let access to the internet only from Windows Internet Explorer). So what I did is turn it off and everything worked well
, except that when I typed a new address, it went to it and then, in some minutes it went back ot the first webpage that I visited. So what I do is close that app and then open it again and type the next address
. Is there any other way to do that 


