Copy link to clipboard
Copied
I have called this in a On a ENTER_FRAME event and it works but it causes my program to be buggy so I want call it only when someone resizes the window is there any way to do this
function sizewidth() {
if(stage.nativeWindow.width >800){
BIG()
}
if(stage.nativeWindow.width <800){
SMALL()
}
}
//addEventListener(Event.ENTER_FRAME, onEnter, false, 0, true);
function onEnter(evt:Event):void {
sizewidth()
}
Copy link to clipboard
Copied
Hi.
Add a NativeWindowBoundsEvent.RESIZING event listener.
import flash.events.NativeWindowBoundsEvent;
function windowResizeHandler(e:NativeWindowBoundsEvent):void
{
trace(stage.nativeWindow.width, stage.nativeWindow.height);
}
stage.nativeWindow.addEventListener(NativeWindowBoundsEvent.RESIZING, windowResizeHandler);
I hope this helps.
Regards.
JC
Copy link to clipboard
Copied
thank you helped much
Copy link to clipboard
Copied
You're welcome!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now