# Update after stage resize

**URL:** <https://forum.kirupa.com/t/update-after-stage-resize/220764>\
**Category:** flash\
**Created:** [March 29, 2007, 12:47am UTC](https://forum.kirupa.com/t/update-after-stage-resize/220764 "2007-03-29T00:47:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![plankguy](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@plankguy](https://forum.kirupa.com/u/plankguy)\
**Post date:** [March 29, 2007, 12:47am UTC](https://forum.kirupa.com/t/update-after-stage-resize/220764/1 "2007-03-29T00:47:50Z")

</div>

I’m trying to call a function only \*\*after \*\*the stage is resized.

```
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000] **var** [/COLOR] stageSizeListener:[COLOR=#0000FF]Object[/COLOR] = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]Object[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];

```

stageSizeListener.[COLOR=#0000FF]onResize[/COLOR] = [COLOR=#000000] **function** [/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
doFunctionCOLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]

[COLOR=#0000FF]Stage[/COLOR].[COLOR=#0000FF]addListener[/COLOR]COLOR=#000000[/COLOR];  
[/LEFT]  
[/FONT]

That calls the function constantly as the stage is resized, but how would I call the function only **once after** the stage is resize?! I’ve tried ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000FF]if[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]Stage[/COLOR].[COLOR=#0000FF]width[/COLOR] != previousStageWidth[COLOR=#000000])[/COLOR]  
[/LEFT]  
[/FONT]

but where can I define the variable previousStageWidth?? Arrggggh. Please help before i’m crack my skull open on my desk!
