Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
mx.managers 
IBrowserManager 
Packagemx.managers
Interfacepublic interface IBrowserManager extends IEventDispatcher

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The interface that the shared instance of the BrowserManager implements. Applications listen for events, call methods, and access properties on the shared instance which is accessed with the BrowserManager.getInstance() method.

See also



Public Properties
 PropertyDefined By
  base : String
[read-only] The portion of current URL before the '#' as it appears in the browser address bar.
IBrowserManager
  fragment : String
[read-only] The portion of current URL after the '#' as it appears in the browser address bar.
IBrowserManager
  title : String
[read-only] The title of the application as it should appear in the browser history.
IBrowserManager
  url : String
[read-only] The current URL as it appears in the browser address bar.
IBrowserManager
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
IEventDispatcher
 Inherited
Dispatches an event into the event flow.
IEventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
IEventDispatcher
  
init(value:String = null, title:String = null):void
Initializes the BrowserManager.
IBrowserManager
  
Initializes the BrowserManager.
IBrowserManager
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
IEventDispatcher
  
Changes the fragment of the URL after the '#' in the browser.
IBrowserManager
  
Changes the text in the browser's title bar.
IBrowserManager
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
IEventDispatcher
Events
 Event Summary Defined By
  Dispatched when the URL is changed by the browser.IBrowserManager
  Dispatched when the URL is changed either by the user interacting with the browser, invoking an application in AIR, or by setting the property programmatically.IBrowserManager
  Dispatched when the URL is changed by the application.IBrowserManager
Property Detail

base

property
base:String  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The portion of current URL before the '#' as it appears in the browser address bar.



Implementation
    public function get base():String

fragment

property 
fragment:String  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The portion of current URL after the '#' as it appears in the browser address bar. Use the setURLFragment() method to change this value.



Implementation
    public function get fragment():String

title

property 
title:String  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The title of the application as it should appear in the browser history.



Implementation
    public function get title():String

url

property 
url:String  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The current URL as it appears in the browser address bar.



Implementation
    public function get url():String
Method Detail

init

()method
public function init(value:String = null, title:String = null):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Initializes the BrowserManager. The BrowserManager will get the initial URL. If it has a fragment, it will dispatch a BROWSER_URL_CHANGE event. This method sets the value of the ApplicationGlobals.application.historyManagementEnabled property to false because the HistoryManager generally interferes with your application's handling of URL fragments.

Parameters

value:String (default = null) — The fragment to use if no fragment is in the initial URL.
 
title:String (default = null) — The title to use if no fragment is in the initial URL.

initForHistoryManager

()method 
public function initForHistoryManager():void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Initializes the BrowserManager. The HistoryManager calls this method to prepare the BrowserManager for further calls from the HistoryManager. You cannot use the HistoryManager and call the setFragment() method from the application. As a result, the init() method usually sets the value of the ApplicationGlobals.application.historyManagementEnabled property to false to disable the HistoryManager.

setFragment

()method 
public function setFragment(value:String):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Changes the fragment of the URL after the '#' in the browser. An attempt will be made to track this URL in the browser's history.

If the title is set, the old title in the browser is replaced by the new title.

To store the URL, a JavaScript method named setBrowserURL() will be called. The application's HTML wrapper must have that method which must implement a mechanism for taking this value and registering it with the browser's history scheme and address bar.

When set, the APPLICATION_URL_CHANGE event is dispatched. If the event is cancelled, the setBrowserURL() method will not be called.

Parameters

value:String — The new fragment to use after the '#' in the URL.

setTitle

()method 
public function setTitle(value:String):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Changes the text in the browser's title bar. This method does not affect the browser's history.

Parameters

value:String — The new title to use in the browser's title bar.

Event Detail

browserURLChange

Event
Event Object Type: mx.events.BrowserChangeEvent
property BrowserChangeEvent.type = mx.events.BrowserChangeEvent.BROWSER_URL_CHANGE

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Dispatched when the URL is changed by the browser.

The BrowserChangeEvent.BROWSER_URL_CHANGE constant defines the value of the type property of the event object for a browserURLChange event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
lastURLThe previous value of the BrowserManager's url property.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
urlThe new value of the BrowserManager's url property.

change

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.CHANGE

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Dispatched when the URL is changed either by the user interacting with the browser, invoking an application in AIR, or by setting the property programmatically.

The Event.CHANGE constant defines the value of the type property of a change event object.

This event has the following properties:

PropertyValue
bubblestrue
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object that has had its value modified. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event.

urlChange

Event  
Event Object Type: mx.events.BrowserChangeEvent
property BrowserChangeEvent.type = mx.events.BrowserChangeEvent.URL_CHANGE

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Dispatched when the URL is changed by the application.

The BrowserChangeEvent.URL_CHANGE constant defines the value of the type property of the event object for a urlChange event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
lastURLThe previous value of the BrowserManager's url property.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
urlThe new value of the BrowserManager's url property.