# How do I getUrl if I need this code...for GreyBox

**URL:** <https://forum.kirupa.com/t/how-do-i-geturl-if-i-need-this-code-for-greybox/240830>\
**Category:** flash\
**Created:** [October 6, 2007, 10:27pm UTC](https://forum.kirupa.com/t/how-do-i-geturl-if-i-need-this-code-for-greybox/240830 "2007-10-06T22:27:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichGags](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/richgags/32/685_2.png) [@RichGags](https://forum.kirupa.com/u/RichGags)\
**Post date:** [October 6, 2007, 10:27pm UTC](https://forum.kirupa.com/t/how-do-i-geturl-if-i-need-this-code-for-greybox/240830/1 "2007-10-06T22:27:45Z")

</div>

Id like to display GreyBox over my flash site. It involves putting this in the head…

```auto
<script type="text/javascript">
    var GB_ROOT_DIR = "http://mydomain.com/greybox/";
</script>
<script type="text/javascript" src="greybox/AJS.js"></script>
<script type="text/javascript" src="greybox/AJS_fx.js"></script>
<script type="text/javascript" src="greybox/gb_scripts.js"></script>
<link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" />

```

It is called from a html link like this…

```auto

<a href="http://google.com/" onclick="return GB_showFullScreen('Google', this.href)">Visit Google</a>

```

How would I write a flash function to call this from flash and have it communicate with the webpage flash is sitting in?

Thanks!  
Rich

---

<div class="post-metadata">

**Author:** ![saliksalik](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@saliksalik](https://forum.kirupa.com/u/saliksalik)\
**Post date:** [June 19, 2008, 6:44am UTC](https://forum.kirupa.com/t/how-do-i-geturl-if-i-need-this-code-for-greybox/240830/2 "2008-06-19T06:44:57Z")

</div>

can you share your solution?

Regards,

Mike

---

<div class="post-metadata">

**Author:** ![saliksalik](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@saliksalik](https://forum.kirupa.com/u/saliksalik)\
**Post date:** [June 19, 2008, 6:45am UTC](https://forum.kirupa.com/t/how-do-i-geturl-if-i-need-this-code-for-greybox/240830/3 "2008-06-19T06:45:57Z")

</div>

I’ve been trying to do this with no luck.

Regards,

Mike

---

<div class="post-metadata">

**Author:** ![RichGags](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/richgags/32/685_2.png) [@RichGags](https://forum.kirupa.com/u/RichGags)\
**Post date:** [June 19, 2008, 9:43pm UTC](https://forum.kirupa.com/t/how-do-i-geturl-if-i-need-this-code-for-greybox/240830/4 "2008-06-19T21:43:55Z")

</div>

I actually was disappointed with the Greybox. It did not work well over flash for me.

I went with Shadowbox. You can get it online.

You will need to follow the instructions provide with shadowbox and put the proper .js references in the head.

Here’s the function I found on the net that connects the flash movie to the Shadowbox.

\<script type=“text/javascript”\>

function abrirSB(type, title, url)  
{  
Shadowbox.init({skipSetup: true});  
Shadowbox.open({type: type, title: title, content: url, height: 800, width: 600});  
};

\</script\>

Then you will need actionscript for your button, something like…

on (release) {  
getURL(“javascript:abrirSB(‘swf’, ‘Breakfast Menu’, ‘[http://www.mysite.com/menus/breakfast.swf](http://www.mysite.com/menus/breakfast.swf)’);”, “\_self”);

}
