Link to home
Start Free TrialLog in
Avatar of petersego
petersego

asked on

Why is stageHeight 100 px smaller

I have a very strange problem with stage.stageHeight.
I have the usual stage-size of 550x400, but for some reason the stageheight is only showing (and tracing) as 300. Whatever I set the scenesize at, the stage.stageHeight is always 100 px smaller. For example in this example, where the stageWidth fills out the entire scene, but in the buttom there is a 100 px white background.

var bg:Sprite;
bg=new Sprite();
bg.graphics.beginFill(0x006699,0.7);
bg.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
bg.graphics.endFill();
addChild(bg);

What is wrong?
Avatar of conagraman
conagraman
Flag of United States of America image

if you know the height and width why not hard code it?

 instead of stage.stageHeight try just puting 400
Avatar of petersego
petersego

ASKER

Well, because I will not know it, except in this question, where I wanted to show the problem.
ic

try setting the sprite's height and width to stage height /width
Im not sure what you mean.
I have no problem solving this problem for this movie - var realstageHeight=stage.stageHeight+100 solves it;
But Im looking for the underlying problem. Is it an IDE-error, some configuration-savings, thats gone wrong or am I missing something...
ASKER CERTIFIED SOLUTION
Avatar of conagraman
conagraman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Create a new Project and add only one line

trace(stage.stageWidth + ", " + stage.stageHeight);
For some reason the problem suddenly disappeared this morning. I have no idea why. But thanks for your suggestions anyway.
The reason your stage height is smaller is because you have the Flash Bandwidth profiler on. This is a classic bug with Flash player, and has been around since the dawn of time.

The solution is to close the bandwidth profiler when debugging your movie. Your clients won't experience this issue.

T
Aaah, you are absolutely right.
I have already awarded points for this question, so I have created a new question at this location, where you can get your welldeserved points.
https://www.experts-exchange.com/questions/26983033/Why-is-stageheight-100-px-smaller-2.html