# Can I call a function in my SWF and pass it a parameter from JavaScript in the page?

**URL:** <https://forum.kirupa.com/t/can-i-call-a-function-in-my-swf-and-pass-it-a-parameter-from-javascript-in-the-page/50124>\
**Category:** flash\
**Created:** [April 29, 2004, 3:37pm UTC](https://forum.kirupa.com/t/can-i-call-a-function-in-my-swf-and-pass-it-a-parameter-from-javascript-in-the-page/50124 "2004-04-29T15:37:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jOEL](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jOEL](https://forum.kirupa.com/u/jOEL)\
**Post date:** [April 29, 2004, 3:37pm UTC](https://forum.kirupa.com/t/can-i-call-a-function-in-my-swf-and-pass-it-a-parameter-from-javascript-in-the-page/50124/1 "2004-04-29T15:37:52Z")

</div>

Hello.  
I’m trying to call a function in frame 1 of my SWF and also pass it a parameter.

I need to do this from elsewhere on the embedding HTML page using JavaScript.

For example call the function flashFunction(foo);

Does this require a listener in Flash that listens for the call, excepts “foo” and then calls the flashFunction and passes “foo” to it?

Can this be called directly without a listener?  
Can this be done at all?

Any help would be greatly appreciated.

// jOEL
