Highlighted

stage.nativeWindow.width how to call

Community Beginner ,
Dec 20, 2018

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()

}

Views

124

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

stage.nativeWindow.width how to call

Community Beginner ,
Dec 20, 2018

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()

}

Views

125

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 20, 2018 0
Adobe Community Professional ,
Dec 21, 2018

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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 21, 2018 1
Community Beginner ,
Dec 21, 2018

Copy link to clipboard

Copied

thank you helped much

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 21, 2018 1
Adobe Community Professional ,
Dec 21, 2018

Copy link to clipboard

Copied

You're welcome!

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 21, 2018 0