# Javascript:setFlashHeight problem

**URL:** <https://forum.kirupa.com/t/javascript-setflashheight-problem/281424>\
**Category:** Uncategorized\
**Created:** [February 9, 2009, 8:05am UTC](https://forum.kirupa.com/t/javascript-setflashheight-problem/281424 "2009-02-09T08:05:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lints](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@lints](https://forum.kirupa.com/u/lints)\
**Post date:** [February 9, 2009, 8:05am UTC](https://forum.kirupa.com/t/javascript-setflashheight-problem/281424/1 "2009-02-09T08:05:37Z")

</div>

hi there,

I’m having a problem with a site im building where there is a changable stage height which passes the height to the browser so you only have a vertical scroll when it’s required.

I’ve had it working like this:

```auto

Stage.scaleMode = "noScale";
Stage.align = "TL";

onEnterFrame = function () {
    var point:Object = {x:_level0.details.footer.innerfooter._x, y:_level0.details.footer.innerfooter._y};
    _level0.details.footer.innerfooter.localToGlobal(point);
    var xPos:Number = Math.ceil(point.y);
    
this.onEnterFrame = function() {
    if (allowResize == "true") {
h = Math.ceil(point.y+_level0.details.footer.innerfooter._height)+520;//
getURL("javascript:setFlashHeight('flashid', "+h+");");
resize();
}    

};
    trace("Converted co-ordinates are "+point.x+", "+point.y);
    trace("xpos is "+xPos);
};

```

but if I try and ditch the h = part and use this code below:

```auto
Stage.scaleMode = "noScale";
Stage.align = "TL";

onEnterFrame = function () {
    var point:Object = {x:_level0.details.footer.innerfooter._x, y:_level0.details.footer.innerfooter._y};
    _level0.details.footer.innerfooter.localToGlobal(point);
    var xPos:Number = Math.ceil(point.y);
    
    this.onEnterFrame = function() {
        if (allowResize == "true") {
            getURL("javascript:setFlashHeight('flashid', "+xPos+");");
            resize();
        }
    };
    trace("Converted co-ordinates are "+point.x+", "+point.y);
    trace("xpos is "+xPos);
};

```

…it doesn’t work :hair:

xPos traces fine and as the site increases in size the number increases accordingly, i just haven’t a clue why it can’t pass that number through when it can for the code at the top of the page.

any help or hints would be grately appreciated as this has had me scratching my head for a very long time now,

cheers  
lints
