-
Reset Stage width with javascript
I am trying to reset the stage width to its orriginal size when user click on button after changes to the browser zoom level.
However this is restting the width of stage according to the new zoom level with the result that the stage size increase even more. I tried using a variable to use as holder of orriginal stageWidth but how to reset it to that width?
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var mystageW:uint=stage.stageWidth;
mybtn.addEventListener(MouseEvent.CLICK,update);
function update(e:MouseEvent):void {
var zoom:uint=stage.stageWidth-mystageW;
if (stage.stageWidth!=mystageW) {
ExternalInterface.call("function( id, w ) { document.getElementById(id).style.width = w + 'px'; }", ExternalInterface.objectID, stage.stageWidth );
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|