# Stage onResize

**URL:** <https://forum.kirupa.com/t/stage-onresize/270018>\
**Category:** flash\
**Created:** [September 4, 2008, 9:09am UTC](https://forum.kirupa.com/t/stage-onresize/270018 "2008-09-04T09:09:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolcotter](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@wolcotter](https://forum.kirupa.com/u/wolcotter)\
**Post date:** [September 4, 2008, 9:09am UTC](https://forum.kirupa.com/t/stage-onresize/270018/1 "2008-09-04T09:09:01Z")

</div>

I have successfully attached four buttons to the stage which all function fine using the following code. The only thing is the content is not re-aligning upon resize. Can someone tell me what I’m doing wrong here? TIA

import com.mosesSupposes.fuse.\*;  
ZigoEngine.simpleSetup( Shortcuts, PennerEasing, Fuse );

Stage.align = “TL”;  
Stage.scaleMode = “noscale”;

var activeClip:MovieClip;

var stageListener:Object = new Object();  
stage.addListener(stageListener);

function positionStuff(): Void {  
c\_01.\_x = (Stage.width/2) - 168;  
c\_01.\_y = (Stage.height_3)/4;  
c\_02.\_x = (Stage.width/2) - 83;  
c\_02.\_y = (Stage.height_3)/4;  
c\_03.\_x = (Stage.width/2) + 2;  
c\_03.\_y = (Stage.height_3)/4;  
c\_04.\_x = (Stage.width/2) + 87;  
c\_04.\_y = (Stage.height_3)/4;  
}

stageListener.onResize = function():Void {  
positionStuff();  
};

this.attachMovie(“clip”,“c\_01”, 2, {\_alpha:0});  
this.attachMovie(“clip”,“c\_02”, 3, {\_alpha:0});  
this.attachMovie(“clip”,“c\_03”, 4, {\_alpha:0});  
this.attachMovie(“clip”,“c\_04”, 5, {\_alpha:0});

positionStuff();

c\_01.alphaTo(100, 2, “linear”, 1);  
c\_02.alphaTo(100, 2, “linear”, 1);  
c\_03.alphaTo(100, 2, “linear”, 1);  
c\_04.alphaTo(100, 2, “linear”, 1);

c\_01.onRelease = function() {  
activeClip.tintTo(0xA4A4A4,1);  
c\_01.tintTo(0x999900,100,.3);

```
activeClip = this;

```

}

c\_01.onRollOver = function() {  
if (this != activeClip) {  
c\_01.tintTo(0x333333,100,.3);  
}  
}

c\_01.onRollOut = function() {  
if (this != activeClip) {  
c\_01.tintTo(0xA4A4A4,100,.6);  
}  
}

c\_02.onRelease = function() {  
activeClip.tintTo(0xA4A4A4,1);  
c\_02.tintTo(0x999900,100,.3);

```
activeClip = this;

```

}

c\_02.onRollOver = function() {  
if (this != activeClip) {  
c\_02.tintTo(0x333333,100,.3);  
}  
}

c\_02.onRollOut = function() {  
if (this != activeClip) {  
c\_02.tintTo(0xA4A4A4,100,.6);  
}  
}

c\_03.onRelease = function() {  
activeClip.tintTo(0xA4A4A4,1);  
c\_03.tintTo(0x999900,100,.3);

```
activeClip = this;

```

}

c\_03.onRollOver = function() {  
if (this != activeClip) {  
c\_03.tintTo(0x333333,100,.3);  
}  
}

c\_03.onRollOut = function() {  
if (this != activeClip) {  
c\_03.tintTo(0xA4A4A4,100,.6);  
}  
}

c\_04.onRelease = function() {  
activeClip.tintTo(0xA4A4A4,1);  
c\_04.tintTo(0x999900,100,.3);

```
activeClip = this;

```

}

c\_04.onRollOver = function() {  
if (this != activeClip) {  
c\_04.tintTo(0x333333,100,.3);  
}  
}

c\_04.onRollOut = function() {  
if (this != activeClip) {  
c\_04.tintTo(0xA4A4A4,100,.6);  
}  
}
