Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Printing In A4 Landscape - Margin Problem



Hi Every1.

Im trying to print a certificate in a4 landscape format and i managed to do that fine, however the problem im getting is that when it prints it does not adjust the margins, which in the end, it ends up with a tiny left margin and a massive right one, even though the movieclip that is being printed is in the correct size etc.
How can I center the movieclip on the print out?

Here is my code:



Code:
import flash.printing.PrintJob;
import flash.display.Sprite;
import flash.text.TextField;
import flash.display.Stage;
import flash.geom.Rectangle;


function PrintScaleExample() {
printPage();
}
function printPage():void {
var pj:PrintJob = new PrintJob();

if (pj.start()) {

var margin_height = (pj.paperHeight - pj.pageHeight) / 2;
var margin_width = (pj.paperWidth - pj.pageWidth) / 2;

try {
certMC.x = margin_width;
certMC.y = margin_height;

certMC.width = 11.11 * 72;
certMC.height = 8.33 * 72;

certMC.rotation = 90;

pj.addPage(certMC);
} catch (error:Error) {
// Do nothing.
}
pj.send();
} else {

}


}

Thanks for your help guys! Really cant find anything or do anything about this, have wasted about a thousand trees due to this issue ¬¬ lol



KirupaForum > Flash > ActionScript 3.0
Posted on: 12-03-2008, 05:36 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Printing Landscape
Hey there guys,

I have set up a button in my flash file which when pressed prints a movie. I was wondering if it is possible to make it automatically print in landscape mode (because it looks better)?

any suggestions?

cheers everyone
me

PRINTING LANDSCAPE
Is there any way to force Flash to print Landscape.

Printing Landscape Possible?
Is it possible from within actionscript to set the print dialog to print landscape?

Printing In Landscape.
Hi,

I am fairly new to Flash and Actionscript so if this question is dumb then so be it.

Here goes.

I am producing an interactive Page Flipping Book. This i have done no problem. I have then incorporated into this book seperate page numbers. This again no problems. I have now decided to add a print facility to this which enables the user to print a specific page in the book. The problem i am having is when i print the page it is cutting off part of it when printing. So i would like to be able to set it so that it prints landscape instead of portrait so this problem will never happen, but i have no idea how to do this.


Here is the actionscript for what i have to make it print.


print_btn.onPress = function() {
printPage(page_number_txt.text);
};
function printPage(pageNumber) {
var page_mc = myBook.getPageLink(pageNumber);
var parent = page_mc._parent._parent;
var visible = parent._visible;
var my_pj:PrintJob = new PrintJob();
if (my_pj.start()) {
var pagesToPrint:Number = 0;
if (!visible) {
parent._visible = true;
}
if (page_mc && my_pj.addPage(page_mc)) {
pagesToPrint++;
}
if (pagesToPrint>0) {
my_pj.send();
}
if (!visible) {
parent._visible = false;
}
}
delete my_pj;
}

If anybody can help me set this to landscape so that the user doesnt have to alter the print preferences everytime then this would be great.


I hope somebody can help as i am really stuck.


Cheers for now


Dan

Printing Landscape In Flash
Can anyone help me with how to print in flash. right now i can get it to print portrait but not landscape.

thanks
J-

Printing In Landscape Format
Hello... searched far and wide through the forums, but was unable to find one topic related to this issue. All I want to know is if there is a way to tell the printer to print landscape instead of portrait in MX 2004? Thanks in advance for any insight ya'll gurus can provide.

[F8] Printing: Portrait --> Landscape
Is there any way in flash, in any of the ways of printing using action script, to change the print orientation from portrait to landscape? All help appreciated.

-D. Smaug

Printing Landscape In Flash
Is there any way of sending a movie to print but ensure that the printout will be printed landscape rather than the preset portrait?

I know the printing function is pretty powerful, but how powerful is it?

I look forward to any replies!

Black Line On The Left Margin When Printing
The printing functionality for a coloring book app working great in AS2. After porting to AS3 users get a black border on the left side of the page.

Have anyone had this problem or know of any solutions?

Thanks in advance for your time.

Script For Default Printing (landscape)
Is there a way to make the viewer's printer default to landscape when printing a flash site?

Printing For Landscape Or Portrait Orientation
hi friends
i need help in printing the document in flash....i need to set the size for print portrait and Landscape....any1 help me with the code

Setting Landscape/portrait When Printing In Flash.
Hey everyone. First time poster with a flash problem that needs solving.

I made some online forms in flash, and these forms have a single print button that;ll print out all the pages. The issue here is that some of the forms are designed to be printed on A4 portrait sized paper while other pages are designed for landscape. I know that that portrait and landscape option is available before printing any form, but is there any way for to code each page so that each of them prints at a certain angle?

Any help would be appreciated.

Landscape Printing Of A Specific Subarea Of The Stage Using PrintJob
Hi all,

does anyone know how to set a specific area of a .swf (for instance, the top left 400 pixels) to print in landscape mode?

I need to allow users of my application the ability to select whether they want to print in landscape or portrait mode, and I need the area they elect to print to be sized to fit the page.

Thanks ;-)

Printing A Landscape Image As A Portrait Such That It Fits Paper
Hi, I am trying to flip my image horizontally so that it will print as a portrait. This is the printing script I am using and was wondering if anyone knows what I can add to make it print as a portrait. Thanks - PS I am new to action script so you pretty much have to spell it out for me.

on(press) {
function do_print() {
_root._yscale = _root._xscale = 80;
//add your print call here
gotoAndStop (4) ;
Mouse.show();
var myPrintJob:PrintJob = new PrintJob();
var result:Boolean = myPrintJob.start();
if (result) {
myPrintJob.addPage(0, null, {printAsBitmap:true}, _currentframe);
myPrintJob.send();
}
delete myPrintJob;
_root._yscale = _root._xscale = 100;
gotoAndStop (3);
}
do_print();
}

Pop-up Margin?
hello again. I have come upon a new problem and you guys have been so helpful last time...it must be a lack of knowledge on my part as usual!

Here is what I am trying to do:
1) create a non-resizeable, no toolbar, no scrollbar pop-up that launches at a specific size on(release) of a button
2) the pop-up is an html (of an embedded swf)

Here is my problem:
the pop-up right now works on cue at given size and specifications EXCEPT the html is for some reason quite a distance to the left (reaaally large left margin, maybe 100 px or so) and given my no resize specification, the right side of my swf is cut off a great deal.

My code for the button that launches the pop-up is:
on (release) {
getURL ("javascript:NewWindow=window.open('http://shearquality.com/straight/views/quintV.html','newWin','width=600,height=580,left=0 ,top=0,toolbar=No,location=No,scrollbars=No,status =No,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");
}

I have no knowledge of javascript and have seen that some people include a script in their html that embeds the swf file but I have no idea what that's about so I didn't do it. THink that matters? Can you help me out please?

Thanks again SO much!!!

Margin When Publishing
I'm getting this marging when I publish my fla.
Any hints??
I published as "match movie" and it is supposed to bleed off the page...
thank you in advance

Pop Up Window With Zero Margin
I have written the below script to pop up a new window

<SCRIPT LANGUAGE="JavaScript">
function popup(url) {
window.open(url,'','toolbar=no,location=no,directo ries=no,status=no,menubar=no,scrollbars=ye

s,resizable=yes,width=800,height=600,left=50,top=5 0');
}
</script>

The new window contain a flash movie, but there are still some margins left outside the flash movie. I would like to know how can I do so that there is no margin and the flash movie can exactly fit the window size. Thanks.

p.s. I have tried to select "No border" in Flash's publishing setting, but it doesn't work..Thanks

Removing Margin
I'm using Flash MX 2004. I have one image that I want to show up flush to the top at 0px and the other image to be flush to the left at 0px. I have both images set up on the stage in flash just so but when I try to publish this to HTML, a border or margin is showing up on the top and left side of the HTML screen and the images are moved down and to the right a few pixels. How do I get rid of this border so that my HTML will look exactly like the Flash stage?

I appreciate any insight on this... Thanks.

Margin Problem
Hi, i want to have for background a jpg picture but when i preview it in a broser, there is always a margin(comes from background) beetwen picture and browser window, any ideas how to cancel margin?

Thanks

Margin Problem
Hi, i want to have for background a jpg picture but when i preview it in a broser, there is always a margin(comes from background) beetwen picture and browser window, any ideas how to cancel margin?

Thanks

Popup Without Margin
Using the centered popup tutorial as an example is it possible to call the popup window with 0 margins from within flash or can this only be done by specifying it in the html?

Javascript No Margin
Hi,

I'm trying to create all sorts of different flash stuff, and I'm loading these images, but vertically there isn't enough space for them, so I was planning on creating a popup window with the image, whenever pressed. So, I just used the great code for launching a popup window, here from Kirupa - http://www.kirupa.com/developer/mx/centered_popup.htm

Now, everything works just fine, the popup window appears, with the right image, and everything, the only problem is, that I'm going code it, so the popup window can't be scaled, and there is a margin on the image. So there's some white space, and some of the image is cut off.

Can anyone help me adding some code to the launching pop-up window tutorial, so that there won't be any margins?


btw, what a nice weather ( here in Denmark at least )

Top Bottom Margin Help
i still need to get rid of the extra space at the top and bottom of this site
for my client.
The site is

garston.com

Need help asap
Thanks
http://www.garston.com/

Popup Without Margin
Using the centered popup tutorial as an example is it possible to call the popup window with 0 margins from within flash or can this only be done by specifying it in the html?

White Margin Around SWF In Browser
Just created my first swf, and published it. Opened the html file to view in Netscape, everything worked fine, everything was the right size too. But as soon as I copied the html code and pasted into place inside a table <td> on another webpage (my index page), ran into trouble. Opened up the file in Netscape, and saw a gigantic white border around it. Not only that, but the movie had reduced in size to nearly 10% of the original size!

Thought to check the marginheight and marginwidth parameters in the body tag: "0" for both. Tried monkeying with the <td> width and height and margin parameters. Tried increasing the dimensions of the swf. It's nearly 2am here, and I'm about the call it quits for now, but hope someone will come to my aid and give me some tips how to embed the html code on my webpage.

How to get rid of the white margin? Why is Netscape reading the file as so tiny in this page, when in the html file it comes out the right size?

I'm using html 1.0 with Netscape Composer, for what it's worth. I know, I know, it's ancient history, but so am I.

Thanks in advance!

Page With Undesired Margin
Hi,

Maybe it could be basic, but It never happens to me before. I made a button in Flash MX, inserted it in a htm page (Button.htm), that calls another htm archive (Page.htm) The work is for Internet Explorer and for a 1024x768 resolution, so the page called fits allright horizontally in that resolution, but when it is called, appears an extra margin that generates an horizontal scroll, and gives the vertical scrooll an extra size too (both of them looks like gray extra spaces).

Also, If I refresh the page called (Page.htm) with F5, the horizontal scroll disappears, so it means is well constructed, because as I said, it fits allright in that resolution... so then... what is happening? I want to call that page from the flash button but I don't want this extra space, so at the end the page coul be viewed correctly.

I'm sending you the archives involved.

Thanks in advance for the answer.
DAVID

Stage.width...how To Set A Margin?
Hi everybody!

I have a datagrid on my stage.
The width of this datagrid is set by:

myDatagrid._width = Stage.width;

..so my datagrid has the same width as the users browser screen...BUT:
I need a right-margin on that datagrid, so that I still have approx.100px at the right side.

So I did:

myDatagrid._width = Stage.width - 100;

Works great, EXCEPT when i resize my browswer, the datagrid does not stretch anymore..

Does anyone know how to fix this?
Regards,

Vic.

TextField & Margin Top Property ... If Any ...
Hello everyone,

I use very often textfield with html texts ans css. The marginLeft and marginRight properties are very familiar to me but ...
Is there any marginTop (& marginBottom) property available ? None if I read the documentation... well I probably missed something ...
So how can I specify the distance in pixels between the top of my TextField and the top of my text ?
Thanks a lot for any advice you can give me ...

Flash Margin Widths
I can change the body width as often as I want, as soon as I publish the file it goes back to its old settings. Does anybody have any idea how to make the change stick?

Different browsers such as Internet Explorer and Netscape have different margin widths. Because you want to maximize the animation and "Take up every pixel of space available!", you don't want the margins to interfere with what your visitors see. You want to remove the margins. To remove margins, delete the <body> tag and place the following line in its place:
<body topmargin="0" leftmargin="0">

Setting 0 Pixel Margin
I hear this will fix the issue with Firefox, but how exactly do I do this?

BTW: I'm using Flash MX 2004 Professional

Margin Problems With CreateTextField
In the code below I'm creating a text field with a left and right margin. It seems the left margin works but it only pushes the text outside the box and the right margin doesn't work at all. Can anyone help me out with this?


Code:
function showLinks() {
_root.createEmptyMovieClip("archive_btn", 999);
archive_btn._x = 100;
archive_btn._y = 100;
archive_btn.createTextField("linkBox", 1, 0, 0, 0, 0);
archive_btn.linkBox.border = true;
archive_btn.linkBox.borderColor = 0xFFFFFF;
archive_btn.linkBox.background = true;
archive_btn.linkBox.backgroundColor = 0x990000;
archive_btn.linkBox.textColor = 0xFFFFFF;
archive_btn.linkBox.selectable = false;
archive_btn.linkBox.autoSize = 'left';
archive_btn.linkBox.text = "Archive";
myformat = new TextFormat();
myformat.font = "Arial";
myformat.leftMargin = 10;
myformat.rightMargin = 10;
archive_btn.linkBox.setTextFormat(myformat);
//
archive_btn.onRelease = function() {
trace("press");
};
}

Flash Margin Widths
I can change the body width as often as I want, as soon as I publish the file it goes back to its old settings. Does anybody have any idea how to make the change stick?

Different browsers such as Internet Explorer and Netscape have different margin widths. Because you want to maximize the animation and "Take up every pixel of space available!", you don't want the margins to interfere with what your visitors see. You want to remove the margins. To remove margins, delete the <body> tag and place the following line in its place:
<body topmargin="0" leftmargin="0">

Setting 0 Pixel Margin
I hear this will fix the issue with Firefox, but how exactly do I do this?

BTW: I'm using Flash MX 2004 Professional

Margin Problems With CreateTextField
In the code below I'm creating a text field with a left and right margin. It seems the left margin works but it only pushes the text outside the box and the right margin doesn't work at all. Can anyone help me out with this?


Code:
function showLinks() {
_root.createEmptyMovieClip("archive_btn", 999);
archive_btn._x = 100;
archive_btn._y = 100;
archive_btn.createTextField("linkBox", 1, 0, 0, 0, 0);
archive_btn.linkBox.border = true;
archive_btn.linkBox.borderColor = 0xFFFFFF;
archive_btn.linkBox.background = true;
archive_btn.linkBox.backgroundColor = 0x990000;
archive_btn.linkBox.textColor = 0xFFFFFF;
archive_btn.linkBox.selectable = false;
archive_btn.linkBox.autoSize = 'left';
archive_btn.linkBox.text = "Archive";
myformat = new TextFormat();
myformat.font = "Arial";
myformat.leftMargin = 10;
myformat.rightMargin = 10;
archive_btn.linkBox.setTextFormat(myformat);
//
archive_btn.onRelease = function() {
trace("press");
};
}

Print As Landscape?
anybody know how to set up a print button to print a file as a landscape??

Set Printer To Landscape
Is it possible to set a printer to landscape using a flash movie?

I have a movie that prints when a button is released, but it's meant to be printed in landscape mode. I would like to remove the "Please print in landscape" warning, and just make the print landscape automatically.

If it is possible, I would really appreciate being pointed in the right direction.

Thanks for any replies.

Landscape Scolling?
I am trying to construct a landscape that automatically scolls when the user moves the mouse.Right now I can’t make it stop scrolling without changing frame. The user is supposed to stay in the landscape, and interact with different objects(movie clips)

Here is my code:

onClipEvent (enterFrame) {

// this code makes the movie clip ”map” move in the opposite direction as the mouse (question 1)

_root.map._x = _root.map._x-(_root._xmouse-_root.map._x)/20;

// this code checks if the mouse hits the movie clip ”three”, and if so sends the playhead to the next frame (question 2)

if (_root.map.three.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.nextFrame();
}

I have two questions:

1. How to stop ”map”’s movement when it reaches the edge of the movie?(I don’t want to use nextFrame).Can I maybe check x and y coords? If so, how?

2. How to send the playhead to a different frame than nextFrame?(gotoandPlay doesn’t seem to work)

Scrolling Landscape
Hi there!

I'm making a header/navigation with scrolling landscape/background with trees and grass, that scroll seperately when moving the mouse. Works fine, but I want the landscape, trees and grass only scrolling when the mouse cursor is over it and not continous scrolling when moving the mouse cursor on other parts of the stage.

Who can help me?

Thanks!


The code which is attached to the MC's:

MC background:

onClipEvent (enterFrame) {
if (_root.mainVar == 0) {
homeX = (-_root._xmouse)+700;
} else {
homeX = (-_root.mainVar)+700;
}
thisX = _x;
diffX = homeX-thisX;
if (_root.mainVar == 0) {
moveX = diffX/30;
} else {
moveX = diffX/5;
}
_x = thisX+moveX;
}


MC trees:

onClipEvent (enterFrame) {
if (_root.mainVar == 0) {
homeX = (-_root._xmouse*2)+1050;
} else {
homeX = (-_root.mainVar*2)+1050;
}
thisX = _x;
diffX = homeX-thisX;
if (_root.mainVar == 0) {
moveX = diffX/30;
} else {
moveX = diffX/5;
}
_x = thisX+moveX;
}


MC grass:

onClipEvent (enterFrame) {
if (_root.mainVar == 0) {
homeX = (-_root._xmouse*3)+1400;
} else {
homeX = (-_root.mainVar*3)+1400;
}
thisX = _x;
diffX = homeX-thisX;
if (_root.mainVar == 0) {
moveX = diffX/30;
} else {
moveX = diffX/5;
}
_x = thisX+moveX;
}

Zoom In Landscape
Hello
how can do make a zoom effect like
www.dunun.com
into the landscape realise?
does one know tutorials?
or movies ?

THX

Matze

Landscape Or Portrait
Hey there.

I am trying to determine the orientation of a picture.
I have the image source, but what I'd like, is being able to know, given the source - the orientation of the image and hence use the proper orientation on the display.

Any ideas?

Thanks.

Landscape Or Portrait
Hey there.

I am trying to determine the orientation of a picture.
I have the image source, but what I'd like, is being able to know, given the source - the orientation of the image and hence use the proper orientation on the display.

Any ideas?

Thanks.

Landscape Or Portrait
Hey there.
I am trying to determine the orientation of a picture.
I have the image source, but what I'd like, is being able to know, given the source - the orientation of the image and hence use the proper orientation on the display.
Any ideas?
Thanks.

Zoom & Landscape
Got a question here. Is there any way to make a button(s) that automates the zoom tool in flash player?

Also, I'm using #P in keyframes and the GetURL print method, does anyone know how I can tell the printer to automatically print in landscape mode?

Thanks in advance.

Scrolling Landscape? Help
I have been working on a scrolling landscape after beeing inspired by the Volvo X90 website; http://www.volvoxc90.no/

I am obviously not doing it the right way; Now I have put together fragments of the terrain as several movieclips controlled by the mousemovement. The problem is that I have offset them to the left of the viewable screen to make them appear as I "move" the mouse towards the left. This ofcourse makes it all hell to control, as the clips are way off screen, and everything is loaded at once so it is heavy too. Even more so this cant be the way, because Flash is restricted to some 2000pixels in the width, wich I'm knacking at because of the length of the landscape.. Help me anyone! Does anyone have a clue about how the Volvo landscape was made?

Thanx

Margin On Externally Loading JPEG
Hi all,

basically I am using the as function to open external files, files could be anything an swf, gif, jpeg, mov, mp3 etc... see below
-----------------------------------------------------------------
function showlink(file, width, height){
if(typeof(width) == "undefined"){
var asFix = file.split(",");
var file = asFix[0];
var width = asFix[1];
var height = asFix[2];
}
var winAttrib = "width=" + width + ",height=" + height + ",menubar=0,status=0,toolbar=0";
_root.getURL("javascript: void(window.open('" + file + "','popupWin','"+winAttrib+"'));");
}
--------------------------------------------------------------------

it is working perfect for .swf files however when I try to open images,it opens with a white margin around the edge. (groan!!!)

here is the HTML TAG
---------------------------------------------------------
<font color ="#0000ff"><u><A HREF= "asfunction:showLink, image.jpg,300,400">Jpeg Image</A></u></font>
--------------------------------------------------------
the above eg. uses dimension 300, and 400, but I would also like an option that just defaults to the size of the file opening up (in this case would you leave the width and height blank?)

can anyone help?

Flash Inexplicably Adding Top Margin - Help
Hi

I am tearing my hair out with this issue amd I am hoping it is just something daft that I have done or a know bug that I can fix with your help!!!!

For some reason, Flash has started doing 2 odd things today...

1. It is adding a top and bottom margin/border/gap to all my published movies. I get rid of all the margins in Dreamweaver but even when the movie is right at the top of the screen, I get this 10 pixel gap.

2. Also I cannot get the movie to sit at the top of the page. It just floats in the middle even if i fix alignment in Dreamweaver (in in Publish Settings in Flash MX2004) to "top".

You can see this at www.digita.com.au/flash/problem.html

The fla is at www.digita.com.au/flash/problem.fla

This has just started happening today so I am very confused! Any help would be very much appreciated.

Sonia

Excessive Margin Height At The Top Of The Page
Some of my users are reporting an excessive margin height at the top of the page when printed from flash... My flash app is designed to print at about a quarter of an inch below the top of the page... Some users are seeing it print a full half inch below that which is setting off some issues with printing as for these users, it prints past the perforation in the paper.

I can't seem to find an answer to this anywhere I look... and what's worse, I can't recreate it, so I can't diagnose it.

Has anyone had such a problem with flash apps they've developed?

I thought about changing my windows dpi in system settings, tried that, and it didn't change the printout at all..

Thanks for any help

Loading XML, But First Line Has A Margin/indent
hi everyone,

I am loading XML into actionscript no problem, however on displaying it in a text item, inside a MC which is being attached, the first line of each paragraph is what looks like to have an indent, margin.

Not really sure why, has anyone else come across this prob, or might know how to resolve??

Thanks in advance

How Do You Adjust A Textfield's Top & Bottom Margin?
Is it possible? I can't find any documentation on it and I hope that I am simply missing it because it seems kind of strange that you can adjust the left and right but not top and bottom.

Copyright © 2005-08 www.BigResource.com, All rights reserved