# AS3 problem isolating a substring

**URL:** https://forum.kirupa.com/t/as3-problem-isolating-a-substring/292814
**Category:** flash
**Created:** [July 19, 2009, 4:53pm UTC](https://forum.kirupa.com/t/as3-problem-isolating-a-substring/292814 "2009-07-19T16:53:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jimbaker](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@jimbaker](https://forum.kirupa.com/u/jimbaker)
#### Post date: [July 19, 2009, 4:53pm UTC](https://forum.kirupa.com/t/as3-problem-isolating-a-substring/292814/1 "2009-07-19T16:53:18Z")

</div>

I hope someone here can explain to me how to isolate a file name from the end of a URL link. It’s driving me nuts. The URL’s will have varying lengths so I need to grab everything that comes after the equals Sign ( = )

```auto
    private function linkHandler(evt:MouseEvent):void {
        if(shareScreen.mouseY < 80) {
            stage.focus = shareField;
            shareField.setSelection(0,999999);
            
// The next line copies a URL to the clipboard so the user can copy and paste it elsewhere.
// a typical URL looks like this but the length will not always be the same.
// http://mymail.playourvideo.net/vmccplayer.htm?ID=ccotest.mp4

            System.setClipboard(config['link']);

// I need to get the file name, in this case " ccotest.mp4 ' into a text variable so the
// next 2 lines will work but I can't get it to work. Can someone advise me how.
            
// I added these 2 lines to call a php routine that actually FORCE A
// DOWNLOAD of the file instead.
            url = 'force_download.php?file='+encodeURI(config['link']);
            navigateToURL(new URLRequest(url));

```

Any help will sure be appreciated - Jim
