# Simple AS2 button calling javascript not working

**URL:** <https://forum.kirupa.com/t/simple-as2-button-calling-javascript-not-working/328807>\
**Category:** flash\
**Created:** [June 18, 2012, 10:30pm UTC](https://forum.kirupa.com/t/simple-as2-button-calling-javascript-not-working/328807 "2012-06-18T22:30:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterfconn](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@peterfconn](https://forum.kirupa.com/u/peterfconn)\
**Post date:** [June 18, 2012, 10:30pm UTC](https://forum.kirupa.com/t/simple-as2-button-calling-javascript-not-working/328807/1 "2012-06-18T22:30:33Z")

</div>

anyone help me please.

I have a button with the following AS2 code. I want the browser to go back to the top but it doesn’t work. any ideas??

on (press) {  
import flash.external.ExternalInterface;  
ExternalInterface.call(“window.scrollTo(0,0)”);

}

working in CS5 but publishing to Flash 6;(
