Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 369
  • Last Modified:

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?
0
petersego
Asked:
petersego
  • 4
  • 3
  • 2
  • +1
2 Solutions
 
conagramanCommented:
if you know the height and width why not hard code it?

 instead of stage.stageHeight try just puting 400
0
 
petersegoAuthor Commented:
Well, because I will not know it, except in this question, where I wanted to show the problem.
0
 
conagramanCommented:
ic

try setting the sprite's height and width to stage height /width
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
petersegoAuthor Commented:
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...
0
 
conagramanCommented:
petersego

i cant tell what the reason could be for it.
the only thing i can think of is that the default orientation is set that way somehow (which i dont know how you could do that). i tried your exact code and it worked the way it should have.  i would need to see your file to try and get a better answer for you.
0
 
dgofmanCommented:
Are you getting this size in Debug mode or when "Publish" Flash project.
It may be problem in generation HTML file (JvaScript)
0
 
dgofmanCommented:
Create a new Project and add only one line

trace(stage.stageWidth + ", " + stage.stageHeight);
0
 
petersegoAuthor Commented:
For some reason the problem suddenly disappeared this morning. I have no idea why. But thanks for your suggestions anyway.
0
 
tomaugerdotcomCommented:
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
0
 
petersegoAuthor Commented:
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.
http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_26983033.html
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now