# SWFAddress AS2.0 trouble

**URL:** <https://forum.kirupa.com/t/swfaddress-as2-0-trouble/295778>\
**Category:** flash\
**Created:** [September 4, 2009, 2:49am UTC](https://forum.kirupa.com/t/swfaddress-as2-0-trouble/295778 "2009-09-04T02:49:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nate51](https://avatars.discourse-cdn.com/v4/letter/n/4da419/32.png) [@nate51](https://forum.kirupa.com/u/nate51)\
**Post date:** [September 4, 2009, 2:49am UTC](https://forum.kirupa.com/t/swfaddress-as2-0-trouble/295778/1 "2009-09-04T02:49:04Z")

</div>

Ok, I now have it semi working and I hope someone can help me get over the last hurdle here.

When you go to the links directly ex.  
[www.xxxx.com/index.html#about](http://www.xxxx.com/index.html#about)  
or  
[www.xxxx.com/index.html#home](http://www.xxxx.com/index.html#home)  
It goes right to those pages exactally as I need it, but for some reason when I click the buttons it doesnt change the link status so if you go to the about page and click home your address will remain as  
[www.xxxx.com/index.html#about](http://www.xxxx.com/index.html#about)

Here is the code I am using if someone can see what I am doing wrong that would help a lot.

First frame code

```auto
import SWFAddress;
import SWFAddressEvent;
function replace(str, find, replace) {
 return str.split(find).join(replace);
}
function toTitleCase(str) {
 return str.substr(0,1).toUpperCase() + str.substr(1);
}
function formatTitle(title) {
 return 'SWF Address Test' + (title != '' ? ' / ' + toTitleCase(replace(title, '/', ' / ')) : '');
}
SWFAddress.setStrict(false);
SWFAddress.onChange = function() {
 var value = SWFAddress.getValue(); 
 
 var path = SWFAddress.getPath();
 var id = SWFAddress.getParameter('id');
 gotoAndStop('$' + value); 
 
 SWFAddress.setTitle(formatTitle(path + (id != '' ? '/' + id : '')));
}
gotoAndStop('$' + value);

```

Second frame code

```auto
stop();
SWFAddress.setValue('');
aboutbtn.onRelease = function () {
 SWFAddress.setValue('about');
 SWFAddress.setTitle("About Page");
 gotoAndStop("$about");
}
homebtn.enabled = false;
aboutbtn.enabled = true;
home.gotoAndStop(2);
about.gotoAndStop(1);

```

Third frame code

```auto
stop();
aboutbtn.onRelease = function () {
 SWFAddress.setValue('about');
 SWFAddress.setTitle("About Page");
 gotoAndStop("$about");
}
homebtn.enabled = false;
aboutbtn.enabled = true;
home.gotoAndStop(2);
about.gotoAndStop(1);

```

The forth frame code is exactally like the third frame but the destinations for about are set to home.

Can anyone see where things are going wrong?
