The LzBrowser Class

The LzBrowser object provides services that allow you access to the browser and the Flash player environment. For example, you can launch a URL, check the version of the Flash player and so on, by invoking methods on the LzBrowser object.

The LzBrowser class has the following methods:

getInitArg(queryParameter)

Returns the value of the specified query parameter.

getLoadURL()

Returns the URL used to request the application.

getLoadURLAsLzURL()

Returns the return value of the getLoadURL method as a new LzURL object.

getVersion()

Returns the version of the user’s Flash player.

1oadJS(jsUrl, target)

Runs the JavaScript script specified by the jsUrl in the target. If target is not specified, the JavaScript script runs on the current browser frame.

loadURL(url, target)

Loads the content of the specified URL. If target is not present the new page will be run on the current browser frame.

urlEscape(string)

Applies URL encoding to the specified string.

urlUnescape(string)

Unescapes the specified string to which URL encoding has been applied.

xmlEscape(string)

Escapes XML special characters, such as ‘<’ and ‘>’, so that they can be shown properly in the browser.

For instance, the LZX application in Listing 13.3 tells the user the version of their Flash player.

Listing 13.3. Enquiring the Flash player version
<canvas>
    <text width="300">
        <handler name="oninit">
            this.setText("You are using Flash version " +
                    LzBrowser.getVersion());
        </handler>
    </text>
</canvas>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset