I know it's like a game of spot the difference, but there was a comma missing in the first addPage line.
Main Topics
Browse All TopicsI am trying to insert the following print function into a button and its erroring out when I try to preview the flash (not to mention not print). Can somone point me in the right direction:
btn.onRelease = function()
{
var pj = new PrintJob();
var success = pj.start();
if(success)
{
pj.addPage (0, {xMin : 0, xMax: 400: yMin: 0, yMax: 400});
pj.addPage("mc", {xMin : -300, xMax: 300, yMin: 400, yMax: 800});
pj.send();
}
delete pj;
}
When I run the flash I get this error:
**Error** Scene=Scene 1, layer=Layer 14, frame=1:Line 7: '}' or ',' expected
pj.addPage (0, {xMin : 0, xMax: 400: yMin: 0, yMax: 400});
**Error** Scene=Scene 1, layer=Layer 14, frame=1:Line 10: Unexpected '}' encountered
}
**Error** Scene=Scene 1, layer=Layer 14, frame=1:Line 1: '}' or ',' expected
btn.onRelease = function(){ var pj = new PrintJob(); var success = pj.start(); if(success) { pj.addPage (0, {xMin : 0, xMax: 400: yMin: 0, yMax: 400}); pj.addPage("mc", {xMin : -300, xMax: 300, yMin: 400, yMax: 800}); pj.send(); } delete pj;}
Total ActionScript Errors: 3 Reported Errors: 3
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: ProactivationPosted on 2007-09-07 at 08:38:19ID: 19848656
Try this. I know it looks the same, but this parses ok!
btn.onRelease = function()
{
var pj = new PrintJob();
var success = pj.start();
if (success)
{
pj.addPage(0, {xMin:0, xMax:400, yMin:0, yMax:500});
pj.addPage("mc", {xMin:-300, xMax:300, yMin:400, yMax:800});
pj.send();
}
delete pj;
};