[swfmill] Trying to print
Hello, I am trying to print a page via ActionScript and can not get it to work properly. I think it is a timing issue because some pages print correctly but others are missing pieces of text. I am attaching the routine I am using. If someone would be willing to take a look at it I'd appreciate it. The SWF is embedded in the application as imageInLibrary2 but I have posted the problem swf page on my web site at http://www.donth.com/0002.swf Note: I am using the SWFMILL and MTASC tools. Thanks, Joe Donth The code I am using follows: function DoPrint(id, field){ // id = x and field = 2 var job:PrintJob = new PrintJob(); var OK = job.start(); if(OK){ var clip:MovieClip = createEmptyMovieClip(clip,getNextHighestDepth()); clip.attachMovie(imageInLibrary+field,image,clip.getNextHighestDepth()); var Format:TextFormat = new TextFormat(); Format.font = Verdana Format.size = 8; Format.align = center; var watermark:TextField = clip.createTextField(watermark,clip.getNextHighestDepth(),0,0, job.pageHeight,12); clip.watermark.embedFonts = true; clip.watermark.text = id; clip.watermark.setTextFormat(Format); clip.watermark._rotation = 90; clip.border = true; clip._xscale = Math.floor((job.pageWidth / job.paperWidth) * 100); clip._yscale = Math.floor((job.pageHeight / job.paperHeight) * 100); job.addPage(clip,{xMin:0,xMax:job.pageWidth,yMin:0,xMax:job.pageHeight}); job.send(); } delete job; if(OK){return YES } else {return NO} } ___ swfmill mailing list swfmill@osflash.org http://osflash.org/mailman/listinfo/swfmill_osflash.org
Re: [swfmill] Question about swfmil output
Mark, Thank you for your prompt and reasoned reply. I didn't know the issue was about reverse-engineering. I *appreciate* your response. Regards, Joe - Original Message - From: Mark Winterhalder [EMAIL PROTECTED] To: swfmill@osflash.org Sent: Sunday, March 04, 2007 11:19 AM Subject: Re: [swfmill] Question about swfmil output On 3/4/07, Joseph Donth [EMAIL PROTECTED] wrote: Pardon the question but as a newcomer to this list I'm not sure what the rules are yet. Mark's comment ...you won't get any meaningful help here unless you come up with a convincing story that explains why you need to do it. prompted me want to ask what did Mark (and perhaps Bob?) mean? What kind of assistance falls into each category? There are two big problems Flash developers face, particularly with online games, that are connected to decompiling/reverse engineering. One is ripping of online content (i.e., taking somebody else's SWF and using it on your own site) and the other is cheating at online competitions to gain prices. There are mechanisms to make both difficult, and PlayerTracker, as it appeared in the decompile in the thread on the OSFlash list, points into the direction of the latter (tracking the player's progress on the server). That said, there are of course many legitimate reasons for reverse engineering an SWF, and Swfmill can be very helpful in some of them. If somebody has such a reason, it helps to explain it, otherwise most will think they might help to break a mechanism a fellow developer intentionally put in place. But I'm not aware of any particular rules -- you're free to ask or reply in any manner you like. Reverse engineering is OK, I, personally, don't even have a problem with somebody trying to make #1 on a highscore list. I just think such an honour should be deserved by either scoring high or having the 1337 skillz to manipulate the SWF on one's own. :) Mark ___ swfmill mailing list swfmill@osflash.org http://osflash.org/mailman/listinfo/swfmill_osflash.org -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.7/710 - Release Date: 3/4/2007 1:58 PM ___ swfmill mailing list swfmill@osflash.org http://osflash.org/mailman/listinfo/swfmill_osflash.org
[swfmill] Not understanding the frame command (I think)
My problem seems to be in the way I am mtascing and swmilling the application. If you'll indulge me: I am taking a PDF file and running it through swftools's pdf2swf program. This is creating a 12 frame SWF file from my test pdf. I am then trying to use MTASC and SWFMILL to create a SWF file that I can control via the ocx to print each page (actually I want to be able to print the first page, ask the user if it printed correctly and if so, print the remainder of the document. (In my example, pages 2 thru 12). The SWF file that is being created (after MTASC and SWFMILL) consists of ONE frame i.e. Flash.totalFrames = 1 (where as if I use the original file from the pdf2swf program I get the actual 12 frames. I'm guessing I don't understand what I'm doing (which I don't) to build this application correctly. Why did I go from a 12 frame SWF to a single frame SWF? I hope this explains my problem and I also hope that someone has the time to give a newbee a hand. Thanks, Joe My three files are as follows: application.xml ?xml version=1.0 encoding=iso-8859-1? movie version=8 width=240 height=170 framerate=30 background color=#ff/ clip import=build/classes.swf / frame library clip id=Application class=Application / clip id=Project class=Project import=src/library/test.swf / /library place id=Application name=app x=0 y=0 depth=1000 / /frame /movie application.as class Application extends MovieClip { function onLoad (){ attachMovie (Project, project, 1000); } } project.as import flash.external.ExternalInterface; class Project extends MovieClip { var dateField:TextField; function Project(){ createTextField(dateField,1,0,0,100,25); dateField.text = ; if(ExternalInterface.available){ ExternalInterface.addCallback(setDate, this, callMe); ExternalInterface.addCallback(doPrint, this, DoPrint); } } function setDate(value) { dateField.text = value; } function onLoad(){ ExternalInterface.call(Ready); } function DoPrint(){ print(Project,bframe); } } build command batch file ( Note: %1 = c:\devel\flash\test\project.as ) @echo off rem Set loc to the Path of the file (i.e. c:\devel\flash\test\) set loc=%~p1 rem Set name to the Name of the file (i.e. project.as) set name=%~n1%~x1 rem define the location(s) of the MTASC library directories set base=c:\devel\flash\std set base8=c:\devel\flash\std8 mtasc -version 8 -swf classes.swf -header 1:1:30 -cp %loc% -cp %base% -cp %base8% Application.as %1 swfmill simple %loc%application.xml %loc%final.swf ___ swfmill mailing list swfmill@osflash.org http://osflash.org/mailman/listinfo/swfmill_osflash.org
[swfmill] Getting started question
I am new to swfmill and have two questions. First, is there a way to search the archives for a subject. I don't want to post a question that has been already answered but I can't find any way to research it (without reading the whole list). Second, my problem I am seeking assistance with: I have a swf file that contains 12 frames. When I follow the examples provided by Mark Winterhalder's Using swfmill to create SWFs without Flash, I end up with a single frame SWF that contains all 12 of my original SWF files frames. I am trying to print the first frame and then with a second print request frames 2 thru 12. I am using the activeX component flash9b.ocx under Windows XP. Regards, Joe Donth My three files are as follows: application.xml ?xml version=1.0 encoding=iso-8859-1? !--clip id=PeeingDog class=PeeingDog import=src/library/PeeingDog.swf / -- movie version=8 width=240 height=170 framerate=30 background color=#ff/ clip import=build/classes.swf / frame library clip id=Application class=Application / clip id=PeeingDog class=PeeingDog import=src/library/flash_vb.swf / /library place id=Application name=app x=0 y=0 depth=1000 / /frame /movie application.as class Application extends MovieClip { function onLoad (){ attachMovie (PeeingDog, peeingDog, 1000); } } peeingdog.as import flash.external.ExternalInterface; class PeeingDog extends MovieClip { var dateField:TextField; function PeeingDog(){ createTextField(dateField,1,0,0,100,25); dateField.text = ; if(ExternalInterface.available){ ExternalInterface.addCallback(callMe, this, callMe); ExternalInterface.addCallback(DoPrint, this, DoPrint); } } function callMe(value) { dateField.text = value; } function onLoad(){ ExternalInterface.call(Ready); } function DoPrint(value){ dateField.text = value; print(PeeingDog,bframe); } } ___ swfmill mailing list swfmill@osflash.org http://osflash.org/mailman/listinfo/swfmill_osflash.org