# Embedding a URL into a swf

**URL:** <https://forum.kirupa.com/t/embedding-a-url-into-a-swf/330840>\
**Category:** flash\
**Created:** [March 27, 2013, 5:32am UTC](https://forum.kirupa.com/t/embedding-a-url-into-a-swf/330840 "2013-03-27T05:32:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lesh](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@Lesh](https://forum.kirupa.com/u/Lesh)\
**Post date:** [March 27, 2013, 5:32am UTC](https://forum.kirupa.com/t/embedding-a-url-into-a-swf/330840/1 "2013-03-27T05:32:20Z")

</div>

I am trying to embed a URL into my swf file. I have placed an invisible button and given it the following actionscript:

```auto
function linkToSite(evt:MouseEvent):void {

     var url:String = "http://www.google.com"; // replace with your url

     var req:URLRequest = new URLRequest(url);

     navigateToURL(req, "_self");

}
urlBtn.addEventListener(MouseEvent.CLICK, linkToSite);

```

When I open the swf file the link doesn’t work. Can anyone help me? I have attached my files.

Thanks
