# Need to implement swfaddress

**URL:** https://forum.kirupa.com/t/need-to-implement-swfaddress/289257
**Category:** Uncategorized
**Created:** [May 28, 2009, 4:10am UTC](https://forum.kirupa.com/t/need-to-implement-swfaddress/289257 "2009-05-28T04:10:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![icebot07](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@icebot07](https://forum.kirupa.com/u/icebot07)
#### Post date: [May 28, 2009, 4:10am UTC](https://forum.kirupa.com/t/need-to-implement-swfaddress/289257/1 "2009-05-28T04:10:16Z")

</div>

another question for you as3 gurus:

i have this code i set up to trap my id’s (which come from an xml file). i’m trying to set up swfaddress to load each activityid, then get my URLs working…

```auto
public function showActivityID(activityid:String):void {
            
            for (var i:uint = 0; i<thumbs.length; i++) {
                
                if (activityid == thumbs*.activityid) {
                    
                    displayEvent(thumbs*);
                }    
            }
        }

```

there’s this code i found in one of the swfaddress tutorials, but i need to modify it to work with my code. i’ve got a variable, swfVar, with the SWFAddress.getValue(); in my main class constructor, looking for ways to put it all together…

swfVar = SWFAddress.getValue();

```auto
function btnClick(e:MouseEvent) {
    SWFAddress.setValue(e.target.deepLink);
}

function handleSWFAddress(e:SWFAddressEvent) {
    try {
        if (currentFrame == 2 && e.value == '/') {
            play();
        } else {
            gotoAndStop('$' + e.value);
        }
    } catch(err) {
        gotoAndStop('$/error/');
    }
    var title:String = 'SWFAddress Website';    
    for (var i = 0; i < e.pathNames.length; i++) {
        title += ' / ' + e.pathNames*.substr(0,1).toUpperCase() + e.pathNames*.substr(1);
    }
    SWFAddress.setTitle(title);
}
SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleSWFAddress);
stop();

```
