revBrowser Question
Posted: Sun Aug 21, 2016 10:33 am
Hello forum readers:
I have a card on which I want to display different PDFs. On the card I have different buttons that upon clicking will open a particular PDF. I could put the following script on each button (note: the line numbers are not part of the script):
This technique works, but I am thinking that a skilled programmer can put some code in the card script that will make the repetition of all of the above code (except the path and file name) in each button unnecessary. I am thinking the use of customs commands can make the scripting more elegant, but I don't know how to write it. Is the above technique the only way? I tried putting lines 4 and 5 in the card script, but that does not work.
If it can be done on the card level, can it be done so that different card scripts can call upon a stack script, or different substacks scripts can call upon a mainstack script?
Thanks for your suggestions or answers.
Monty
I have a card on which I want to display different PDFs. On the card I have different buttons that upon clicking will open a particular PDF. I could put the following script on each button (note: the line numbers are not part of the script):
Code: Select all
1 global gBrowserID
2 on mouseup
3 resetcard
4 put revBrowserOpenCEF(the WindowID of this stack) into gBrowserID
5 revBrowserSet gBrowserID, "rect", the rect of grc "browser"
6 revBrowserSet gBrowserID, "url", "file:c/path_of_intended_pdf/pdf_file.pdf"
7 end mouseup
8
9 on resetcard
10 repeat for each item gBrowserID in revBrowserInstances()
11 revBrowserClose gBrowserID
12 end resetcard
If it can be done on the card level, can it be done so that different card scripts can call upon a stack script, or different substacks scripts can call upon a mainstack script?
Thanks for your suggestions or answers.
Monty