Page 1 of 1

dynamic vars in rev browser

Posted: Sun Sep 30, 2007 1:45 pm
by reelstuff
Hello everyone,

I am attempting to open a new browser window, this is the example code from the documentation,

Code: Select all

on browserNewUrlWindow pInstanceId, pUrl
	  go stack (the owner of me)
	end browserNewUrlWindow


While experimenting with the browser and clicking on a link that opens in a new window, I used the message watcher, I can see that the following occurs.

Code: Select all

browserBeforeNavigate
 browserBeforeNavigate
browserNewURLWindow
 BrowserNewUrLWindow
browserBeforeNavigate
 browserBeforeNavigate

I am wondering the best way to use revBrowserOpen function

dynamically, to open a new "window"

revBrowserOpen(windowId [, url ] )

The challenge is that with this code, uses revBrowserOpen to load the initial URL

Which I would like to do dynamically,

Code: Select all

command browserInit
  local tBrowserId
  put revBrowserOpen(the windowId of this stack, "http://somewebsitecomcom/index.php") into tBrowserId
  browserEnsure tBrowserId
  put tBrowserId into sBrowserId
  
  revBrowserSet sBrowserId, "rect", the rect of graphic "Browser Rect" of me
  revBrowserSet sBrowserId, "scrollbars", true
end browserInit

So if I had a field, uField_url

which has a variable of http://mywebsite.com and

I put that into the revBrowserOpen(windowId [, uField_url ] )

which I am sure does not work, but for the sake of experimentation.

I am wondering how I can put, dynamic URL into a new browser and open it to show the new content.

any suggestions or thoughts are always welcomed.

Tim

Posted: Sat Mar 15, 2008 6:29 am
by mcgrath3
Tim,

Did you ever figure this one out? What did you do to open the link in a new window with a browser object?

Tom McG

Posted: Sun Mar 16, 2008 12:27 am
by reelstuff
mcgrath3 wrote:Tim,

Did you ever figure this one out? What did you do to open the link in a new window with a browser object?

Tom McG
Hi, sadly, I moved on without finding the best overall solution, I am hoping for some big enhancements, Soon, but so far, I have given up on this plugin as it is, I believe that it has some good potential, which I expect we will learn more about sometime after may of this year.

Posted: Sun Mar 16, 2008 12:51 am
by BvG
I have never used the browser object much, but to make a new window with a browser object, you need to make a new stack, adn create a browser object in that. In the same step, you send an url to the new browser object.

An untested example:

Code: Select all

on mouseUp
  put "http://some.url.you.like.com" into theURL
  create stack "new browser"
  put revbrowseropen(the windowID of stack "new browser", theURL) into theIdentifier
  --revbrowser opens with a rect of 0,0,0,0 so you need to set it correctly
  revBrowserSet theIdentifier, "rect", the rect of this card
end mouseUp

Posted: Sun Mar 16, 2008 1:10 am
by reelstuff
BvG wrote:I have never used the browser object much, but to make a new window with a browser object, you need to make a new stack, adn create a browser object in that. In the same step, you send an url to the new browser object.

An untested example:

Code: Select all

on mouseUp
  put "http://some.url.you.like.com" into theURL
  create stack "new browser"
  put revbrowseropen(the windowID of stack "new browser", theURL) into theIdentifier
  --revbrowser opens with a rect of 0,0,0,0 so you need to set it correctly
  revBrowserSet theIdentifier, "rect", the rect of this card
end mouseUp
Thank you, yes, that would be the ticket,

I will check that out, I appreciate your post and info thanks.