# Using javascript with navigateToURL

**URL:** <https://forum.kirupa.com/t/using-javascript-with-navigatetourl/280781>\
**Category:** flash\
**Created:** [January 31, 2009, 7:26pm UTC](https://forum.kirupa.com/t/using-javascript-with-navigatetourl/280781 "2009-01-31T19:26:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tihku](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tihku](https://forum.kirupa.com/u/tihku)\
**Post date:** [January 31, 2009, 7:26pm UTC](https://forum.kirupa.com/t/using-javascript-with-navigatetourl/280781/1 "2009-01-31T19:26:24Z")

</div>

Hi!

I’m new to here, cause I’ve been trying to find solution to this one, but haven’t got any answers elsewhere…

So my question is, how can I pass “custom” javascript command to html page I’m currently, from flash. I’m trying to get lightwindow ([http://www.stickmanlabs.com/lightwindow/#howtouse](http://www.stickmanlabs.com/lightwindow/#howtouse)) to work, but everything that happens, is that it opens a new window saying:

```auto
myLightWindow.activateWindow({
    href: 'http://stickmanlabs.com/images/kevin_vegas.jpg', 
    title: 'Waiting for the show to start in Las Vegas', 
    author: 'Jazzmatt', 
    caption: 'Mmmmmm Margaritas! And yes, this is me...', 
    left: 300});

```

Here is my code in flash:

```auto
var jscommand:String = "javascript:"myLightWindow.activateWindow({
    href: 'http://stickmanlabs.com/images/kevin_vegas.jpg', 
    title: 'Waiting for the show to start in Las Vegas', 
    author: 'Jazzmatt', 
    caption: 'Mmmmmm Margaritas! And yes, this is me...', 
    left: 300});"; 
                        var url:URLRequest = new URLRequest(jscommand); 
                        navigateToURL(url, "_self");

```

So I just don’t get it… Anyone familiar to lightwindow?
