Copy link to clipboard
Copied
Hi.
I'm working on a project for a website and I've so far created some menus. You can see it here: http://ecstweb.comuv.com/temp/f1/site_fc.html
I'm using Flash CS6 on OSX and I tested this in Firefox and Safari.
The menus are movie clips containing the menu items, which are sprites with classic text fields and shapes for the backgrounds. The fonts are embedded and the animations are tweens. All of this is generated at runtime.
When I resize the browser window, the whole content distorts during the resizing and then goes back to the correct proportions when I stop. Is there a way to prevent this distortion?
Thank you.
Copy link to clipboard
Copied
are you using a resize listener?
Copy link to clipboard
Copied
Yes. I have this in my document class:
public function Main() {
addEventListener(Event.ADDED_TO_STAGE, iniciate);
stage.addEventListener(Event.RESIZE, resizeAdjust);
}
private function iniciate(e:Event):void {
removeEventListener(Event.ADDED_TO_STAGE, iniciate);
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
}
private function resizeAdjust(e:Event):void {
//Menu alignment.
_mMainMenu.x = (stage.stageWidth - _mMainMenu.width)/2;
_mTopMenu.x = (stage.stageWidth - _mTopMenu.width)/2;
//Background image scaling
_mBackground.scaleBg();
}
Copy link to clipboard
Copied
This may not do anything but one thing you could try is adding this to the end of your resizeAdjust function:
new MouseEvent("").updateAfterEvent();
EDIT: However, it is working fine in Chrome on Windows so it might just be a browser/OS issue.
Copy link to clipboard
Copied
Thanks. Tried your addition but it remains the same. Also tried just adding a text field to the stage and not adding the background and menus, and I got the same problem, so maybe it's just the way it's supposed to be and I think the whole jerky scaling is weird.
I'll try to see it in windows to see if I can spot any differences.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now