Hi
Can someone explian to my why, when I resize the window of the flash player the square does not remain in exactly the same place, ie 10,10.
And what I should do so that it does?
Thank you
package
{
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;
/**
* Example class to test the FluidBackground class.
* @author Alan Jhonnes
*/
public class FluidBackgroundExample extends Sprite
{
public var square:Sprite = new Sprite();
public function FluidBackgroundExample() {
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
square.graphics.beginFill(0x000000);
square.graphics.drawRoundRect(10,10,100,stage.stageHeight - 200,10);
square.graphics.endFill();
stage.addChild(square);
stage.addEventListener(Event.RESIZE, resizeListener);
}
public function resizeListener (e:Event):void {
square.height = stage.stageHeight - 200;
//It doesnt stay at 10 with respect to the window... It moves down protionally as the window gets longer
square.x = 10;
}
}
}
Thanks
Ward