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
or
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
Here is the code I am using if someone can see what I am doing wrong that would help a lot.
First frame code
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
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
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?