# Loading js vars into flash

**URL:** https://forum.kirupa.com/t/loading-js-vars-into-flash/139542
**Category:** Uncategorized
**Created:** [March 3, 2005, 7:38pm UTC](https://forum.kirupa.com/t/loading-js-vars-into-flash/139542 "2005-03-03T19:38:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![1071\_64302\_R](https://avatars.discourse-cdn.com/v4/letter/1/ec9cab/32.png) [@1071\_64302\_R](https://forum.kirupa.com/u/1071_64302_R)
#### Post date: [March 3, 2005, 7:38pm UTC](https://forum.kirupa.com/t/loading-js-vars-into-flash/139542/1 "2005-03-03T19:38:02Z")

</div>

[color=navy] **hello i got this for my js:** [/color]

```auto
 
SCRIPT LANGUAGE=JavaScript>
<!--
document.write ("width="+screen.width+"height="screen.height)
//-->
</SCRIPT> 

```

**[color=navy]and i have this in the Actions of a movie clip inside the swf[/color]**

```auto
 
onClipEvent (load) {
 _root.navigation._alpha=0;
}
onClipEvent (enterFrame) {
 loadText = new LoadVars();
 loadText.load("main.html");
 loadText.onLoad = function() {
 height.text = this.heightY;
 }
 _root.navigation._y = this.heightY - 100;
}

```

whats this supposed to do? well, its suppose to get the current height of the window and then sending the var to the swf, after it to movieclip inside the swf should get the vars from the html document and to start the var “heightY”, it is not working, so i tried this:

```auto
 
<SCRIPT LANGUAGE=JavaScript>
<!--
   var htmlY = (!document.all)?
 window.innerHeight:document.documentElement.offsetHeight;
 document.myFlash.SetVariable('navY', htmlY)
 window.document.myFlash.SetVariable("navY", htmlY)
//-->
</SCRIPT> 

```

and also this:

```auto
<SCRIPT LANGUAGE=JavaScript>
<!--
   var htmlY = document.write.screen.height
   document.myFlash.SetVariable('navY', 'screen.height')
   window.document.myFlash.SetVariable("navY", sendText)
//-->
</SCRIPT> 

```

so, the code for the movie clip would look like this:

```auto
 
onClipEvent (enterFrame) {
 _root.navigation._y = navY-100;
 }

```

not working…

could someone be so patient and kind of helping me out? ^^’

I’ve been working on this for a while, and i have too much coke and coffee on my veins right now x.x

i beg of you, in the name of flash, help me… u.u
