# Scrolling content from a different frame

**URL:** <https://forum.kirupa.com/t/scrolling-content-from-a-different-frame/293443>\
**Category:** flash\
**Created:** [July 29, 2009, 2:29am UTC](https://forum.kirupa.com/t/scrolling-content-from-a-different-frame/293443 "2009-07-29T02:29:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imelers](https://avatars.discourse-cdn.com/v4/letter/i/b4bc9f/32.png) [@imelers](https://forum.kirupa.com/u/imelers)\
**Post date:** [July 29, 2009, 2:29am UTC](https://forum.kirupa.com/t/scrolling-content-from-a-different-frame/293443/1 "2009-07-29T02:29:36Z")

</div>

Hello people!  
I really need your help!

The scenario is:  
An HTML frameset with 2 frames. I need to create a button in Actionscript 3 (and put it in the top frame) in order to scroll down the content of the main frame. I thought of Javascript. I end up writing a script that works but when I call the Javascript function in Actionscript nothing happens. Maybe a silly mistake maybe not…

If you want to test it, download my files: [http://www.mediafire.com/file/hokzzzwy1rt/scrolltest.rar](http://www.mediafire.com/file/hokzzzwy1rt/scrolltest.rar)

My source code is:

The Javascript in the html of the top frame:

```auto
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
  <!--
   
  function pageScrollDn() 
  { 
     top.mainFrame.scrollBy(0,15);  
     timeID = setTimeout('pageScrollDn()',100);  
  } 
  function stopScroll()  
  { 
     clearTimeout(timeID); 
  }  
   
  //-->
  </SCRIPT>

```

The actionscript for the button:

```auto
button.addEventListener(MouseEvent.MOUSE_OVER, pageScrollDn);
  button.addEventListener(MouseEvent.MOUSE_OUT, stopScroll);
   
  function pageScrollDn(e:MouseEvent):void{
  ExternalInterface.call("pageScrollDn");
  }
   
  function stopScroll(e:MouseEvent):void{
  ExternalInterface.call("stopScroll");
  }

```

I would really appreciate any ideas…
