# Need help bad! Stage onResize troubles :-(

**URL:** <https://forum.kirupa.com/t/need-help-bad-stage-onresize-troubles/68591>\
**Category:** flash\
**Created:** [October 27, 2004, 4:53am UTC](https://forum.kirupa.com/t/need-help-bad-stage-onresize-troubles/68591 "2004-10-27T04:53:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhamej](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rhamej](https://forum.kirupa.com/u/rhamej)\
**Post date:** [October 27, 2004, 4:53am UTC](https://forum.kirupa.com/t/need-help-bad-stage-onresize-troubles/68591/1 "2004-10-27T04:53:55Z")

</div>

\*\*Resolved here \*\*[www.flashkit.com/board/showthread.php?threadid=591753&perpage=20&pagenumber=1](http://www.flashkit.com/board/showthread.php?threadid=591753&perpage=20&pagenumber=1)

I am at a loss so I am posting this in alot of forums. So if you have seen it already I apologize ahead of time.  
I am trying to load a random image into a movie clip that will scale 100%. Then have the content MC noScale and stay the same. It’s got me baffled.  
If I insert a picture into the bg movieclip, it scales and shows up no problem.  
Soon as I try to load a random image into the bg movieClip the picture just does not show up!! But what is even weider, is that I have it set up that if the picture is 100% loaded for another MC to play, which it does! So the picture is there, but it’s invisible??? And no the picture is not progressive.  
arrrgh!!

```auto

Stage.scaleMode = "noScale";
Stage.align = "LT";
bg.onResize = function() {
this._width = Stage.width;
this._height = Stage.height;
};
Stage.addListener(bg);
bg._x = bg._y=0;
bg.onResize();
content.onResize = function() {
this._x = (Stage.width-this._width)/2;
this._y = (Stage.height-this._height)/2;
};
Stage.addListener(content);
content.onResize();
var r = (Math.floor(Math.random()*49)+1).toString();
var mclListener:Object = new Object();
mclListener.onLoadStart = function(bg:MovieClip) {
trace('started');
};
mclListener.onLoadProgress = function(mc, w, t) {
trace('progress: '+w+", "+t);
var w = image_mc.getBytesLoaded();
var t = image_mc.getBytesTotal();
};
mclListener.onLoadComplete = function(bg:MovieClip) {
trace("loaded");
content.gotoAndPlay(2);
};
mclListener.onLoadError = function(bg:MovieClip, errorCode:String) {
trace('not loaded');
};
var image_mc1:MovieClipLoader = new MovieClipLoader();
image_mc1.addListener(mclListener);
image_mc1.loadClip("pictures/photo"+r+".jpg", bg);

```

Here is the fla zipped up. Its in 2004 format. The noLoad fla doesn’t load the random pic. The yesLoad fla does.  
Anyone please. Im at wits end here. :mad:  
[www.solidtorch.com/teststuff/RandomLoad.zip](http://www.solidtorch.com/teststuff/RandomLoad.zip)

Or if anyone has a better solution I am game to try anything right now.  
Thanks for looking.  
Josh
