13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Scripting the AIR HTML Container<br />

If you do not set a user ag<strong>en</strong>t value for either the userAg<strong>en</strong>t property of the HTMLLoader object or for<br />

URLRequestDefaults.userAg<strong>en</strong>t, th<strong>en</strong> the default AIR user ag<strong>en</strong>t value is used. This default value varies dep<strong>en</strong>ding<br />

on the runtime operating system (such as Mac OS or Windows), the runtime language, and the runtime version, as in<br />

the following two examples:<br />

"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; <strong>en</strong>) AppleWebKit/420+ (KHTML, like Gecko)<br />

AdobeAIR/1.0"<br />

"Mozilla/5.0 (Windows; U; <strong>en</strong>) AppleWebKit/420+ (KHTML, like Gecko) AdobeAIR/1.0"<br />

Setting the character <strong>en</strong>coding to use for HTML cont<strong>en</strong>t<br />

Adobe AIR 1.0 and later<br />

An HTML page can specify the character <strong>en</strong>coding it uses by including meta tag, such as the following:<br />

meta http-equiv="cont<strong>en</strong>t-type" cont<strong>en</strong>t="text/html" charset="ISO-8859-1";<br />

Override the page setting to <strong>en</strong>sure that a specific character <strong>en</strong>coding is used by setting the textEncodingOverride<br />

property of the HTMLLoader object:<br />

var html:HTMLLoader = new HTMLLoader();<br />

html.textEncodingOverride = "ISO-8859-1";<br />

Specify the character <strong>en</strong>coding for the HTMLLoader cont<strong>en</strong>t to use wh<strong>en</strong> an HTML page does not specify a setting<br />

with the textEncodingFallback property of the HTMLLoader object:<br />

var html:HTMLLoader = new HTMLLoader();<br />

html.textEncodingFallback = "ISO-8859-1";<br />

The textEncodingOverride property overrides the setting in the HTML page. And the textEncodingOverride<br />

property and the setting in the HTML page override the textEncodingFallback property.<br />

Set the textEncodingOverride property or the textEncodingFallback property before loading the HTML<br />

cont<strong>en</strong>t.<br />

Defining browser-like user interfaces for HTML cont<strong>en</strong>t<br />

Adobe AIR 1.0 and later<br />

JavaScript provides several APIs for controlling the window displaying the HTML cont<strong>en</strong>t. In AIR, these APIs can be<br />

overridd<strong>en</strong> by implem<strong>en</strong>ting a custom HTMLHost class.<br />

Last updated 6/6/2012<br />

1005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!