# Javascript function in PDF document

**URL:** <https://forum.kirupa.com/t/javascript-function-in-pdf-document/308613>\
**Category:** flash\
**Created:** [April 27, 2010, 4:28am UTC](https://forum.kirupa.com/t/javascript-function-in-pdf-document/308613 "2010-04-27T04:28:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asthyanax](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@asthyanax](https://forum.kirupa.com/u/asthyanax)\
**Post date:** [April 27, 2010, 4:28am UTC](https://forum.kirupa.com/t/javascript-function-in-pdf-document/308613/1 "2010-04-27T04:28:44Z")

</div>

Not sure where to post that so sorry if it’s not the right forum. I’m trying to include a swf in a pdf document with a button in it. I’ve looked at the javascript for pdf documentation but I can’t really make anything work. I’m not sure how to communicate between Flash and pdf. I’ve tried a basic AS2

```auto

    getURL("javascript:myfunction();");    

```

and then in the pdf:

```auto
function myfunction()
{
    app.alert("hello")
}

```

and nothing. Does anyone ever tried that? I need some help if you have some time.  
Thank you.

Chris
