WebXtra WEBXTRA HELP: PROPERTIES  
 

WebXtra cast members have only one property:

 

browserServicesAvailable - used to determine if a working browser sprite can be created. WebXtra can only create a working browser sprite when Internet Explorer 5.5 or later is installed, and only in the Windows platform. This property will return FALSE or 0 when the Xtra is running on the Mac platform or in a Windows machine that does not provide the required services. In these cases the Xtra will still operate without any error messages, but will create just a white sprite instead of a fully operational browser window.

Lingo example:

if member(x).browserServicesAvailable = false then

go to frame "nobrowseravailable"

end if

JavaScript syntax example:

if (member(x).browserServicesAvailable == false) {

_movie.go("nobrowseravailable")

}

 

 

WebXtra sprites have several properties that can be used to obtain information from the browser object, or set its behavior. Most properties are available only after the browser is initialized, so make sure to check the information returned for VOID values.

 

busy - Read-only property, indicates if the browser is currently busy or conducting a network operation. It is generally used to display an animation indicating browser activity. Possible return values are TRUE or FALSE (1 or 0).

Lingo example:

put sprite(x).busy

-- 0

JavaScript syntax example:

if ( sprite(x).busy ) {

trace("busy")

}

 

 

offline - Read-only property, indicates if the browser is currently operating in offline mode. It is generally used to detect if an internet connection is available. Possible return values are TRUE or FALSE (1 or 0).

Lingo example:

put sprite(x).offline

-- 0

JavaScript syntax example:

if ( sprite(x).offline ) {

trace("no internet connection available")

}

 

 

silent - This property can be tested and set. When the browser is in silent mode it will not display dialog boxes with error messages and warnings to the end user, for example when a page that contains invalid JavaScript code is loaded. Possible values are TRUE or FALSE (1 or 0).

Example:

sprite(x).silent = 1

 

 

image - Read-only property. Takes a screenshot of the browser window and returns an image object, ready to be used with imaging Lingo functions. Please make sure the browser window is not covered by other elements when this function executes.

Lingo example:

put sprite(x).image

--<image:202bc8>

JavaScript syntax example:

trace (sprite(x).image)

//<<image:202bc8>>

 

 

html - This property can be tested and set. It returns the current HTML code of the main page loaded in the browser window, and can also be used to pass an HTML string to be loaded and displayed by the browser. Important: getting the HTML property stops and cancels any browser operations currently in place, so you may want to test if the browser is busy before issuing this command.

Lingo example:

-- Get the HTML text currently loaded on the browser

member(x).text = sprite(x).html

-- Display new HTML content

sprite(x).html = "My HTML string here"

JavaScript syntax example:

trace (sprite(x).html)

//<BODY>my text here</BODY>

 

 

zoom - This property can be tested and set. It returns the current zoom level of the page loaded in the browser window, and can also be used to set it. This property is only available after a document has been loaded in the browser window. The valid range goes from 10 to 1000 percent of the page size, with the default value being 100. Important: the optical zoom functionality requires Internet Explorer 7 or later on the user's system.

Lingo example:

-- Get the current zoom level

put sprite(x).zoom

-- 100

-- Zoom In

sprite(x).zoom = 300

JavaScript syntax example:

trace (sprite(x).zoom)

//100

 

 

title - Read-only property. Returns the title of the current page loaded in the browser. Applications usually rely on the event "titleChange" to display this information without needing to poll the browser continuously.

Lingo example:

put sprite(x).title

--"Home Page"

JavaScript syntax example:

trace (sprite(x).title)

//"Home Page"

 

 

url - Read-only property. Returns the url of the current page loaded in the browser. Applications usually rely on the events "startNavigation" or "openNewWindow" to store this information without needing to poll the browser continuously.

Lingo example:

put sprite(x).url

--"http://xtras.tabuleiro.com"

JavaScript syntax example:

trace (sprite(x).url)

//"http://xtras.tabuleiro.com"

 

 

browserReference - Read-only property. Returns an unique browser reference ID number that identifies this WebXtra sprite. This number can be used with the "openNewWindow" event to redirect creation of new windows to existing browser sprites. The "Complete Browser" sample included with the Xtra uses this property to redirect new windows requests to a browser sprite hosted in a MIAW, please examine the script "WebBrowser_Behavior" for more information on how it is used.

Lingo example:

put sprite(x).browserReference

--145628

JavaScript syntax example:

trace (sprite(x).browserReference)

//76863