开发者

Flash: stick stage to left side when resize?

开发者 https://www.devze.com 2023-03-23 12:18 出处:网络
I\'m a bit newbie to Flash, and I\'m experiencing strange problem. I have a simple flash application, which when run in Flash player looks like this

I'm a bit newbie to Flash, and I'm experiencing strange problem.

I have a simple flash application, which when run in Flash player looks like this

Flash: stick stage to left side when resize?

the thing is, when i resize the Flash player window, a black frame becomes visible to the left and top of the stage.

Flash: stick stage to left side when resize?

Now, is it possible that these black areas start appearing on the right side, and the stage to be fixed on the left? The strange thing is that these black areas are not part of the stage, the (0,0) coordina开发者_如何学JAVAte is there where white area starts and not in the corner of the window, and that's causing me problems.


Add this in your main class to align the stage in the top left corner:

addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);

private function onAddedToStage(e:Event):void 
{
    removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
    stage.align = StageAlign.TOP_LEFT;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消