# Flash Static Menu(that scrolls w/page)

**URL:** <https://forum.kirupa.com/t/flash-static-menu-that-scrolls-w-page/26340>\
**Category:** flash\
**Created:** [July 22, 2003, 4:29am UTC](https://forum.kirupa.com/t/flash-static-menu-that-scrolls-w-page/26340 "2003-07-22T04:29:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdogg](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jdogg](https://forum.kirupa.com/u/jdogg)\
**Post date:** [July 22, 2003, 4:29am UTC](https://forum.kirupa.com/t/flash-static-menu-that-scrolls-w-page/26340/1 "2003-07-22T04:29:59Z")

</div>

I need help making a flash image static and be able to scroll down with the page  
(eg, [http://www.dynamicdrive.com/dynamicindex4/logo.htm](http://www.dynamicdrive.com/dynamicindex4/logo.htm)  
[http://www.dynamicdrive.com/dynamicindex1/staticmenu3.htm](http://www.dynamicdrive.com/dynamicindex1/staticmenu3.htm))

You guys are pretty smart and I’m sure you’ll be able to help me

Jdogg

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 22, 2003, 4:43am UTC](https://forum.kirupa.com/t/flash-static-menu-that-scrolls-w-page/26340/2 "2003-07-22T04:43:44Z")

</div>

This all happens in the HTML file…  
Place this in the beginning.

```php
<div id="staticbanner" style="position:absolute;">
<!-- PUT YOUR .SWF EMBED CODE BETWEEN THESE TAGS -->
</div>

```

That is the div tag that will contain your Flash movie.

Now right underneath the placement of that div tag add this javascript…

```php
<script>
//define universal reference to "staticbanner"
var crossobj=document.all? document.all.staticbanner : document.getElementById? document.getElementById("staticbanner") : 

document.staticbanner

function positionit(){
//position left
var dsocleft=document.all ? document.body.scrollLeft : pageXOffset
//position top
var dsoctop=document.all ? document.body.scrollTop : pageYOffset
//define universal browser window width
var window_width=document.all? document.body.clientWidth : window.innerWidth

//if the user is using IE 4+ or NS6+
if (document.all||document.getElementById){
crossobj.style.left=parseInt(dsocleft)+
parseInt(window_width)-(window_width)+10 //tells it to be 10px from left side of screen
crossobj.style.top=dsoctop+10 //tells it to be 10px from top of screen
}
//else if the user is using NS 4
else if (document.layers){
crossobj.left=
dsocleft+window_width-window_width+5
crossobj.top=dsoctop+25
}
}
//position the div tag every 1 millisecond
setInterval("positionit()",1)
</script>

```
