# Calling & executing Javascript function in Flash w/AS3

**URL:** <https://forum.kirupa.com/t/calling-executing-javascript-function-in-flash-w-as3/288820>\
**Category:** Uncategorized\
**Created:** [May 21, 2009, 12:21pm UTC](https://forum.kirupa.com/t/calling-executing-javascript-function-in-flash-w-as3/288820 "2009-05-21T12:21:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshcaple](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@joshcaple](https://forum.kirupa.com/u/joshcaple)\
**Post date:** [May 21, 2009, 12:21pm UTC](https://forum.kirupa.com/t/calling-executing-javascript-function-in-flash-w-as3/288820/1 "2009-05-21T12:21:35Z")

</div>

As the title says, I have a JS function (which changes the dimensions of my swf at runtime) & just want to execute the function when the user clicks the resize btn. The functions are ‘flashmin()’ to be executed by ‘bt\_close’ & ‘flashmax()’ to be executed by ‘bt\_open’.  
I assume I need to call it with “import flash.external.ExternalInterface;” but can anyone lay out the necessary code for me, or point me to an appropriate tutorial/s?
