Anyone else has experienced weird behaviors and unexpected values when checking for stage.stageHeight while you have Bandwith Profiler open in Flash IDE?
Say, I have been using this for testing Perlin Noise stuff:
package {
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.Event;
import flash.geom.Point;
[SWF(width="550", height="400", backgroundColor="#000000", frameRate="60")]
public class Clouds extends Sprite {
private var _bitmap:BitmapData;
private var _xoffset:int = 0;
private var _yoffset:int = 0;
public function Clouds() {
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
trace("stage.stageHeight: "+stage.stageHeight);
_bitmap = new BitmapData(stage.stageWidth, stage.stageHeight,true, 0xffffffff);
var image:Bitmap = new Bitmap(_bitmap);
addChild(image);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(event:Event):void {
_xoffset = _xoffset + Math.random()*4 -2;
_yoffset = _yoffset + Math.random()*3;
var point:Point = new Point(_xoffset, _yoffset);
_bitmap.perlinNoise(200, 100, 3, 1000, false, true,
1, true, [point, point]);
}
}
}
As you see here, the swf is set to a height of 400 .. When executed with test movie, control-enter, the trace returns 400 .. now, if you try this with the Bandwidth Profiler open, it would return 300, and the Sprite would only extend to 300 height.
Anyone experiencing the same??