Package | sekati.managers |
Class | public class BrowserManager |
Inheritance | BrowserManager flash.events.EventDispatcher |
BrowserManager provides advanced browser deeplink management to the API via URL Anchor (hash) tag & quasi-page control. Back & Forward browser
button support is provided via a basic polling monitor which allows for a significantly simplified in-line alternative solution to
more complex HTML/JavaScript
centric solutions such as SWFAddress in exchange for a very small performance trade off. In other words:
this is a pure ActionScript solution to the browser "back button" question.
Note: It is important to understand the relationship between BrowserManager
& BrowserAddress
; baseline anchor
management logic can be controlled thru either class but advanced management & notification is best done via the manager.
In general, BrowserManager only dispatches BrowserEvent
events when the user changes the browser
anchor (thru the back/forward button, manually or via BrowserAddress
). The manager intentionally does not dispatch
these events when the application itself changes the anchor via the BrowserManager facility; however if changed via javascript
or actionscript wrappers such as BrowserAddress
the BrowserEvent
will fire.
BrowserManager.$.addEventListener( BrowserEvent.ADDRESS_CHANGE, browserAddressChangeHandler ); function browserAddressChangeHandler(e : BrowserEvent ) : void { trace( " the browser address changed to: " + e.path + " from: " + e.previousPath ); }
See also
Property | Defined by | ||
---|---|---|---|
$ : BrowserManager
[static][read-only]
Shorthand singleton accessor getter
| BrowserManager | ||
isMonitoring : Boolean [read-only]
Whether the manager is currently monitoring the browser for address changes or not.
| BrowserManager | ||
MONITOR_MS : int = 1500 [static]
The amount of time (in milliseconds) between
BrowserAddress checks. | BrowserManager | ||
path : String
The browser anchor path.
| BrowserManager | ||
pathArray : Array
The browser anchor path as an array of paths.
| BrowserManager | ||
title : String
The browser page title.
| BrowserManager |
Method | Defined by | ||
---|---|---|---|
BrowserManager($:SingletonEnforcer = null)
BrowserManager Singleton Constructor
| BrowserManager | ||
back():void
Move back in the browser history.
| BrowserManager | ||
forward():void
Move forward in the browser history.
| BrowserManager | ||
[static]
Singleton Accessor
| BrowserManager | ||
pop():void
Remove the last item from the pathArray.
| BrowserManager | ||
push(val:String):void
Push an item on to the pathArray.
| BrowserManager | ||
startMonitor():void
Start monitoring the browser address for changes.
| BrowserManager | ||
stopMonitor():void
Stop monitoring the browser address for changes.
| BrowserManager | ||
updateMonitor():void
Update the current (tracking) path to the current browser anchor (this prevents the
BrowserManager from dispatching a
BrowserEvent due to a address change). | BrowserManager |
$ | property |
$:BrowserManager
[read-only]Shorthand singleton accessor getter
Implementation public static function get $():BrowserManager
isMonitoring | property |
isMonitoring:Boolean
[read-only]Whether the manager is currently monitoring the browser for address changes or not.
Implementation public function get isMonitoring():Boolean
MONITOR_MS | property |
public static var MONITOR_MS:int = 1500
The amount of time (in milliseconds) between BrowserAddress
checks.
path | property |
path:String
[read-write]The browser anchor path.
Implementation public function get path():String
public function set path(value:String):void
pathArray | property |
pathArray:Array
[read-write]The browser anchor path as an array of paths.
Implementation public function get pathArray():Array
public function set pathArray(value:Array):void
title | property |
title:String
[read-write]The browser page title.
Implementation public function get title():String
public function set title(value:String):void
BrowserManager | () | constructor |
public function BrowserManager($:SingletonEnforcer = null)
BrowserManager Singleton Constructor
Parameters$:SingletonEnforcer (default = null ) — SingletonEnforcer - internal to the AS file; the param prevents external instantiation without error.
|
back | () | method |
public function back():void
Move back in the browser history.
forward | () | method |
public function forward():void
Move forward in the browser history.
getInstance | () | method |
public static function getInstance():BrowserManager
Singleton Accessor
ReturnsBrowserManager —
BrowserManager
|
pop | () | method |
public function pop():void
Remove the last item from the pathArray.
push | () | method |
public function push(val:String):void
Push an item on to the pathArray.
Parametersval:String |
startMonitor | () | method |
public function startMonitor():void
Start monitoring the browser address for changes.
stopMonitor | () | method |
public function stopMonitor():void
Stop monitoring the browser address for changes.
updateMonitor | () | method |
public function updateMonitor():void
Update the current (tracking) path to the current browser anchor (this prevents the
BrowserManager from dispatching a BrowserEvent
due to a address change).