Jpeg encoder - export Stage help

was wondering if someone could tell me how to modify this code so i can export the stage at its dimensions in pixels. Right now the script saves the stage without bounds, unconstrained. I need it to draw the stage at its default 1280x720 stage size and whatever is within the stage bounds, not whats off the stage bounds

Thanks for tip…greatly apreciated

function createJPG(m:MovieClip, q:Number, fileName:String)
{
var jpgSource:BitmapData = new BitmapData (m.width, m.height);
jpgSource.draw(m);
var jpgEncoder:JPGEncoder = new JPGEncoder(q);
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);

var header:URLRequestHeader = new URLRequestHeader (“Content-type”, “application/octet-stream”);

//Make sure to use the correct path to jpg_encoder_download.php
var jpgURLRequest:URLRequest = new URLRequest (“jpg_encoder_download.php?name=” + fileName + “.jpg”);
jpgURLRequest.requestHeaders.push(header);
jpgURLRequest.method = URLRequestMethod.POST;
jpgURLRequest.data = jpgStream;

var jpgURLLoader:URLLoader = new URLLoader();
navigateToURL(jpgURLRequest, “_blank”);}

//Call the function and pass in the movieclip that you want to encode,
//the quality, and the file name
createJPG(this,100,“image”);
}