# Error #1009 - stage problems

**URL:** <https://forum.kirupa.com/t/error-1009-stage-problems/322638>\
**Category:** flash\
**Created:** [May 27, 2011, 6:47pm UTC](https://forum.kirupa.com/t/error-1009-stage-problems/322638 "2011-05-27T18:47:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![evolutionxbox](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@evolutionxbox](https://forum.kirupa.com/u/evolutionxbox)\
**Post date:** [May 27, 2011, 6:47pm UTC](https://forum.kirupa.com/t/error-1009-stage-problems/322638/1 "2011-05-27T18:47:14Z")

</div>

Class called ‘bg’ dynamically creates a background that varies depending on the stage width & height.

```auto
package 
{
	import flash.display.*;
	import flash.events.*;
	import flash.utils.*;

	public class bg extends MovieClip
	{
		var radius:int;
		var repeat:int;
		var circle:Shape;

		public function bg()
		{
			
			repeat = Math.ceil(stage.stageWidth/160)+4;
			
			for (var i:int = repeat; i > 0; i--)
			{
				radius = (40*(4*i-1))/2;
				
				circle = new Shape();
				circle.graphics.clear();
				circle.graphics.beginFill(0x000000);
				circle.graphics.drawCircle(0,0,radius);
				circle.graphics.drawCircle(0,0,radius-40);
				this.addChildAt(circle,1);
				circle.graphics.endFill();
				circle.alpha = 0.11;				
			}
			
			this.bgGradient.scaleX = stage.stageWidth;
			this.bgGradient.scaleY = stage.stageHeight;
			this.bgGradient.x = -(this.bgGradient.width/2);
			this.bgGradient.y = -(this.bgGradient.height/2);
		}
	}
}

```

Apparently I have no access to the stage from this external class… I have seen one solution that means I need to extend the class as a Sprite…

```auto
public class bg extends Sprite { ...

```

… but doing that means not extending it as a movieclip which is what this class references to.

Can anyone help me?
