WebXtra WEBXTRA HELP: FUNCTIONS  
 

WebXtra cast members have only one function:

 

member(x).register(serialnumber) - This function can be used in Projectors to register the Xtra at runtime, and allow developers to save linked casts. It is not necessary for the normal operation of the Xtra, as WebXtra castmembers already save their registration status in the Director movie.

Example:

member("browser").register("SERIALNUMBERHERE")

 

 

WebXtra sprites have several properties that are used to invoke operations of the browser component. These functions are usually called by other interface elements on your movie, such as a menu item used to print the contents of the browser window or a button used to go back to the last page visited in the history.

 

sprite(x).navigate(url) - Used to initiate a navigation to the specified URL.

Example:

sprite(1).navigate("www.macromedia.com")

 

 

sprite(x).navigateFrame(url, frameName) - Used to initiate a navigation to the specified URL in a given HTML frame. This is useful if you want to have script controls in Director that change the content of just one frame while a frameset is loaded in the browser.

Example:

sprite(1).navigateFrame("https://www.secure.com", "_contentFrame")

 

 

sprite(x).execBrowserScript(scripttext) - Passes the specified string as a script to be executed by the Javascript interpreter in the browser. This functionality allows you to execute both built-in Javascript commands and also functions that you define in the HTML page loaded in WebXtra. For reference, check the SCRIPTING sample at the WebXtra tutorials and samples page.

Example:

sprite(1).execBrowserScript("alert('Hello from Director')")

 

 

sprite(x).scrollWindow(xDelta, yDelta) - This function can be used to create a button that scrolls the page loaded in the browser from Lingo, if your interface is not displaying the standard browser scroll bars. It accepts negative and positive values.

Example:

sprite(1).scrollWindow(-10, 100)

 

 

sprite(x).goBack() - Navigates to the previous URL in the browser history, if available.

Example:

sprite(1).goBack()

 

 

sprite(x).goForward() - Navigates to the next URL in the browser history, if available.

Example:

sprite(1).goBack()

 

 

sprite(x).goHome() - Navigates to the Home URL set in the system preferences for the Internet Explorer browser.

Example:

sprite(1).goHome()

 

 

sprite(x).goSearch() - Navigates to the default SEARCH URL set in the system preferences for the Internet Explorer browser.

Example:

sprite(1).goSearch()

 

 

sprite(x).stop() - Stops the current browser operation, aborting any network transfer in progress.

Example:

sprite(1).stop()

 

 

sprite(x).refresh() - Reloads the current URL. Default cache settings will be used to speed up the loading if necessary.

Example:

sprite(1).refresh()

 

 

sprite(x).refresh2() - Reloads the current URL, but forces the browser to ignore any cached information.

Example:

sprite(1).refresh2()

 

 

sprite(x).browserSaveAs() - Opens a standard SAVE AS dialog that can be used to select a filename and options to save the HTML document currently loaded in the browser.

Example:

sprite(1).browserSaveAs()

 

 

sprite(x).browserPageSetup() - Opens the standard PAGE SETUP dialog that can be used to adjust page properties for future printing operations.

Example:

sprite(1).browserPageSetup()

 

 

sprite(x).browserPrintPreview() - Opens the standard PRINT PREVIEW window, where the user can visualize a print job before actually invoking the final print operation.

Example:

sprite(1).browserPrintPreview()

 

 

sprite(x).browserPrint() - Opens the standard PRINT dialog that can be used to select a target printer and print the current HTML page.

Example:

sprite(1).browserPrint()

 

 

sprite(x).browserPrintNoPrompt() - Prints the current HTML page without prompting the user for confirmation

Example:

sprite(1).browserPrintNoPrompt()