Daemonite: FLEXible FlashPaper: Part One Archive

Daemonite: FLEXible FlashPaper: Part One Archive


Friday, July 15, 2005
FLEXible FlashPaper: Part One

The first part of a series building FlashPaper into your Flex application. We find it tremendously useful for large printable docs, reports and the like to keep the document inline and not force the user to pop up a separate window just to print.

With the release of CFMX7 we do have the posibility to generate "FlashPaper". FlashPaper are very similar to Flash movies as we all know them. FlashPaper can be generated either by <cfdocument> or <cfreport> tags.

Flexible Flashpaper

The example uses flashpaper in 3 different ways:

  • static call (flashpaper already exists on the server)
  • cfdocument call: flashpaper will be generated on the fly using cfdocument
  • cfreport call: flashpaper will be generated on the fly as well but using a cfr (cf report) template

Download file

Prerequisites:

  1. download: flashpaper_1.zip
  2. place flash_paper.mxml under your flex server root (or any directory below root)
  3. on your CF server create the following folder structure:
    {your_coldfusion_server_path}/posting/1/
  4. extract the files: cfdocument_example.cfm, cfreport_example.cfm, sample.cfr, guidelines.swf to the just created directory.
  5. Apply changes to the 'contentPath' variable in your flashpaper_part1.mxml to match your server settings.
  6. My CFServer runs under port 8300. Run flashpaper_part1.mxml

That should be it.

To get more functionallity and customization happening on the FlashPaperLoader object please have either a look at the mx.controls.Loader class and its parent classes. you can extend that class and name it something like 'FlashPaperLoader.as' or go to MM website and search for ‘FlashPaper API’. Some documentation can be found. Don’t get mixed up with the articles ‘Flash and FlashPaper’ ;-) similar but different.

Later we’ll look at secure FlashPaper generation passing user credentials to RemoteObjects for the purpose of FlashPaper Generation.

josef

Posted by josef at 05:07 PM | Permalink
Trackback: http://blog.daemon.com.au/cgi-bin/dmblog/mt-tb.cgi/285

Comments

It is important to note that a loaded FlashPaper can only be manipulated if the calling SWF (the Flex app) and the FP SWF are both served from the same domain.

Posted by: Dirk Eismann on July 15, 2005 11:08 PM

this kind of sucks really as you have to now depend on having a CF install along with your Flex install. I'm hoping that Flex 2 has some built in cpapbilities for this and PDF output.

DK

Posted by: Douglas Knudsen on July 16, 2005 12:23 AM

Hardly sucks if CFMX is your backend application server. But then again, you could always generate FlashPaper documents by buying FlashPaper for a 100 bucks.

Posted by: Geoff Bowers on July 17, 2005 11:05 PM