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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Scripting the AIR HTML Container<br />

Accessing the HTML history list<br />

Adobe AIR 1.0 and later<br />

As new pages are loaded in an HTMLLoader object, the runtime maintains a history list for the object. The history list<br />

corresponds to the window.history object in the HTML page. The HTMLLoader class includes the following<br />

properties and methods that let you work with the HTML history list:<br />

Class member Description<br />

historyL<strong>en</strong>gth The overall l<strong>en</strong>gth of the history list, including back and forward <strong>en</strong>tries.<br />

historyPosition The curr<strong>en</strong>t position in the history list. History items before this position repres<strong>en</strong>t “back” navigation, and<br />

items after this position repres<strong>en</strong>t “forward” navigation.<br />

getHistoryAt() Returns the URLRequest object corresponding to the history <strong>en</strong>try at the specified position in the history list.<br />

historyBack() Navigates back in the history list, if possible.<br />

historyForward() Navigates forward in the history list, if possible.<br />

historyGo() Navigates the indicated number of steps in the browser history. Navigates forward if positive, backward if<br />

negative. Navigating to zero reloads the page. Specifying a position beyond the <strong>en</strong>d navigates to the <strong>en</strong>d of<br />

the list.<br />

Items in the history list are stored as objects of type HTMLHistoryItem. The HTMLHistoryItem class has the following<br />

properties:<br />

Property Description<br />

isPost Set to true if the HTML page includes POST data.<br />

originalUrl The original URL of the HTML page, before any redirects.<br />

title The title of the HTML page.<br />

url The URL of the HTML page.<br />

Setting the user ag<strong>en</strong>t used wh<strong>en</strong> loading HTML cont<strong>en</strong>t<br />

Adobe AIR 1.0 and later<br />

The HTMLLoader class has a userAg<strong>en</strong>t property, which lets you set the user ag<strong>en</strong>t string used by the HTMLLoader.<br />

Set the userAg<strong>en</strong>t property of the HTMLLoader object before calling the load() method. If you set this property on<br />

the HTMLLoader instance, th<strong>en</strong> the userAg<strong>en</strong>t property of the URLRequest passed to the load() method is not used.<br />

You can set the default user ag<strong>en</strong>t string used by all HTMLLoader objects in an application domain by setting the<br />

URLRequestDefaults.userAg<strong>en</strong>t property. The static URLRequestDefaults properties apply as defaults for all<br />

URLRequest objects, not only URLRequests used with the load() method of HTMLLoader objects. Setting the<br />

userAg<strong>en</strong>t property of an HTMLLoader overrides the default URLRequestDefaults.userAg<strong>en</strong>t setting.<br />

Last updated 6/6/2012<br />

1004

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

Saved successfully!

Ooh no, something went wrong!