# Javascript to Flash

**URL:** <https://forum.kirupa.com/t/javascript-to-flash/185608>\
**Category:** Uncategorized\
**Created:** [April 14, 2006, 4:49pm UTC](https://forum.kirupa.com/t/javascript-to-flash/185608 "2006-04-14T16:49:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrRobotnik](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/drrobotnik/32/1796_2.png) [@DrRobotnik](https://forum.kirupa.com/u/DrRobotnik)\
**Post date:** [April 14, 2006, 4:49pm UTC](https://forum.kirupa.com/t/javascript-to-flash/185608/1 "2006-04-14T16:49:08Z")

</div>

I’m creating an image gallery that fits to the size of your screen. It basically passes the screen width variable from the javascript to the swf file. It works in Firefox but not IE. I have seen a ton of different suggestions but none seem to be working.

swLiveConnect=“true”

anyways heres the link:

[http://elusiveform.com/gallery/](http://elusiveform.com/gallery/)

Check out my source code for the javascript.

I know for a fact its possible because I have seen people do it.

Thanks.

---

<div class="post-metadata">

**Author:** ![kBisk](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kBisk](https://forum.kirupa.com/u/kBisk)\
**Post date:** [April 14, 2006, 5:27pm UTC](https://forum.kirupa.com/t/javascript-to-flash/185608/2 "2006-04-14T17:27:45Z")

</div>

The setVariable() method you’re using won’t be cross-browser compatible. You’d be better off using document.write() and write the width and height of the flash object that way, rather than trying to set it.

---

<div class="post-metadata">

**Author:** ![DrRobotnik](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/drrobotnik/32/1796_2.png) [@DrRobotnik](https://forum.kirupa.com/u/DrRobotnik)\
**Post date:** [April 14, 2006, 6:58pm UTC](https://forum.kirupa.com/t/javascript-to-flash/185608/3 "2006-04-14T18:58:16Z")

</div>

Ok, how would document.write pass a variable to my swf? My swf isnt resizing, the rectangle movielcips are just repositioning based on the screensize
