# Help Printing from Flash

**URL:** <https://forum.kirupa.com/t/help-printing-from-flash/284311>\
**Category:** flash\
**Created:** [March 17, 2009, 9:22pm UTC](https://forum.kirupa.com/t/help-printing-from-flash/284311 "2009-03-17T21:22:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnat](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@mnat](https://forum.kirupa.com/u/mnat)\
**Post date:** [March 17, 2009, 9:22pm UTC](https://forum.kirupa.com/t/help-printing-from-flash/284311/1 "2009-03-17T21:22:15Z")

</div>

Hi,

I am new adding print functions in Flash. I found a code that prints my swf correctly, but only if I right click print. I tried to make it so that when my print\_btn is pressed the stage is printed, but when I try to add this to the pre-existing code things get messed up and nothing prints.

Any suggestions about how to get my print\_btn working are appreciated!

This the pre-existing code:

```auto
 function PrintScreenShot (target:MovieClip)
	{
		//snapShot(target);

		_screenshot_mc = _root.createEmptyMovieClip ( "screenshot_mc" , _global._depth++ );
		_screenshot = new BitmapData(target._width, target._height, _bTransparent, _bgColor);
		_screenshot.draw(target);
		_screenshot_mc.attachBitmap (_screenshot ,_global._depth++);

		var topLeft = 0;
		var topRight	= _screenshot_mc._width;
		var bottomLeft	= 0;
		var bottomRight	= _screenshot_mc._height;

		_printJob = new PrintJob ();

		if ( _printJob.start () )
		{
			if ( _printJob.addPage( _screenshot_mc , { xMin:topLeft , xMax:topRight , yMin:bottomLeft , yMax:bottomRight } , { printAsBitmap:true } ) )
			{
				_printJob.send ();
			}
		}

		delete _printJob;
		
	
		_root.removeMovieClip( "screenshot_mc" );
		_screenshot.dispose ();
	}

```
