# SWFAddress 2.2 & onInit AS2.0

**URL:** https://forum.kirupa.com/t/swfaddress-2-2-oninit-as2-0/278632
**Category:** flash
**Created:** [January 2, 2009, 9:59pm UTC](https://forum.kirupa.com/t/swfaddress-2-2-oninit-as2-0/278632 "2009-01-02T21:59:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nixon](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nixon](https://forum.kirupa.com/u/nixon)
#### Post date: [January 2, 2009, 9:59pm UTC](https://forum.kirupa.com/t/swfaddress-2-2-oninit-as2-0/278632/1 "2009-01-02T21:59:13Z")

</div>

Hi Folks,

I cannot for the life of me figure out how to grab the current URL and pass it to SWFAddress onInit/onLoad. What I’m trying to accomplish is being about to send a url like:

[http://www.creataVivendi.com/#/contact-us](http://www.creataVivendi.com/#/contact-us)

using:

```php

SWFAddress.onInit = function(){
	checkURL();
}

function checkURL(){
	currentURL = SWFAddress.getValue().split("/").join("");
	getURL("javascript:alert('"+currentURL+"')");
}

```

The checkURL() function works once initialized (from “normal” function calls etc) but not onLoad/Init. It returns nothing (or “/” before I split the string). I want do determine what section to go to on arrival if anything other than /. Is there a way to do this?

Thanks in Advance!

- Nixon
