Page 1 of 1
revBrowser not working in standalone
Posted: Wed Jul 18, 2012 8:54 pm
by doobox
Hi there,
Hoping for ideas why the revBrowser is working correctly in livecode but not in the saved standalone.
I am running the browser on a substack, with just one image as the placeholder for the browser.
Calling the substack from the top menu with simply :
The stack script of the wardenHelp substack is :
Code: Select all
local tBrowserId
on openStack
put revBrowserOpen(the windowId of this stack, "http://www.garysimpson.co.uk/websitewarden_faq/") into tBrowserId
revBrowserSet tBrowserId, "rect", the rect of image "browser"
end openStack
on closeStack
revBrowserClose tBrowserId
end closeStack
Like i say this all works perfectly in livecode but no sign of the browser loading at all in the standalone.?
I tested this with a new project by:
creating main stack with button to call substack
put the same image and code on substack
saved as standalone, and it works..
So why wont the same thing work in my main project..? mystified....
Re: revBrowser not working in standalone
Posted: Wed Jul 18, 2012 11:25 pm
by doobox
More random test have revealed more strangeness.
I sent a copy of the project over to my laptop via dropbox.
Built the standalone on my laptop and it all worked fine. The browser works in a standalone built on my laptop.
So my question is.. what gets changed in a project when you open it on another machine... anything in standalone settings etc..?
The main machine where the browser fails to work in the standalone is a mac pro running two screens if that makes a difference.
Thinking the way the browser references windowId...
Was also thinking maybe some sort of caching on my main machine from an earlier build maybe.. but dont know which way to go from here really.
Re: revBrowser not working in standalone
Posted: Thu Jul 19, 2012 9:14 am
by doobox
After sleeping on it, and many more tests this morning. I decided to try something.
As i said building the app on my main machine, shows me an empty browser window, in the standalone on my main machine.
Building the app on my laptop worked, and i saw the browser working correctly in the standalone on my laptop.
So this morning i sent a copy of a standalone i built on my main machine, over to my laptop.
And was surprised to see, the browser works on the laptop.
So to sum up:
I can build a test project with a browser on my main machine and see it working on my main machine in a standalone.
I cant build my current project on my main machine and see the browser working on my main machine, in a standalone.
I can build my current project on any machine, and see it working on any machine, in a standalone, exept my main machine.
So something is breaking this particular instance of a revBrowser. But only on my main machine.
I would swear it was the fact that i am running 2 screens, if it were not for the fact i can get a test project browser to work.
Nothing seems consistent and i just cant find a common factor here...
Any leads really appreciated.
Re: revBrowser not working in standalone
Posted: Thu Jul 19, 2012 9:55 am
by doobox
Seems the fact is, there is no openStack message being received by the substack.
Tested with simply:
Code: Select all
on openStack
put "working" after field "test"
end openStack
The field remains blank on my main machine..!
This only happens when running the standalone on my main machine in question.
Every other machine displays "working" in the test field, when the substack opens.
This is mental....!
I almost wish it had been something to do with the windowid, and i could have reasoned that this was due to multiple displays.
Re: revBrowser not working in standalone
Posted: Thu Jul 19, 2012 1:41 pm
by sturgis
Quick question. You say it remains blank on that one computer. You use an image object to set the rect of the browser. Does the border around the image object dissapear? (screen goes white, can't see the image object anymore, but no browser content)
Or does the browser never actually fire up? (might put an actual image in the image object so you can see if it disappears easier.)
You might change your browser startup code to something like this:
Code: Select all
on openStack
get revBrowserOpen(the windowId of this stack, "http://www.garysimpson.co.uk/websitewarden_faq/")
if it is an integer then
put it into tBrowserId
revBrowserSet tBrowserId, "rect", the rect of image "browser"
else
answer "There was an error: " && it --if the browser doesn't start, show the error.
end if
end openStack
Re: revBrowser not working in standalone
Posted: Sat Jul 21, 2012 6:32 pm
by doobox
It turned out to be purely down to the fact i was blocking the onOpenStack message elsewhere.
Well i had not passed the message from an onPreOpenStack handler in another stack, anyway.
The thing that was really throwing me was the fact that this was machine specific for what ever reason.
But any way as soon as i passed the on preOpenstack handler from the main stack it all works as expected.
It is in fact finished now, and submitted to the app store.
This is the first time i have submitted a sandboxed app, so fingers crossed.
Here is the app i was working on
http://www.garysimpson.co.uk/websitewarden/