DesignAudit.net

Design Blog using Express Engine

My good friend and superb designer Kerry Layton wanted a nice, clean blog where he could dip his toes into the world of blogging. We had this site up and running within a day, and launched on New Years Day with a collection of calendars to start the year. Check it out.
» launch site | » click to close

Hollyberry Baking Shop

Shopping Cart using Magento

Just in time for the holiday rush, we launched a new, easy to navigate and use shopping cart for Hollyberry Baking. I found Magento a nice platform to work with and it has been a solid solution for Holly integrating closely with her shipping workflow. Design by Marcy Hawley.
» launch site | » click to close

Resa Design Shop

Shopping Cart using X-Cart (OSCommerce)

Resa's success overran her capacity to manage a PayPal shop, so we took her business to the next level with a full featured web store and SEO implementation. Unfortunately the store has exponentially increased Resa's business. Ooops, so sorry Resa. ;-)
» launch site | » click to close

Northstar Church

New Site Design, SEO Update, and News Blog

I stepped in and helped Northstar implement a fantastic design while also updating their SEO. The home page has a nice rotating feature leveraging some cool Flash and Ajax action. Wordpress powers their current news feed. The beautiful design is the handiwork of Becky Siegrist.
» launch site | » click to close

[AC] Advent Conspiracy

Site using Expression Engine

Advent Conspiracy wanted an easier and more flexible solution for their high traffic site. With Boxing Clever, we launched this EE website and tied into social networks such as Flickr, YouTube and Facebook to help spread the word about fresh water wells for impoverished people groups.
» launch site | » click to close

@xtyler pay attention and learn something! ;)  11:23 AM 03/10/2010

AIR

Generate PDFs with Actionscript using AlivePDF

I recently had a Flash / AIR project that required the ability to render PDFs. Evidently, this hasn't been a hot issue in the past for Flash applications, however I get the feeling that AIR may change that. While a web application can utilize any of many server side solutions to render a PDF to the browser, it's not the same for AIR.

In looking for a good solution, I quickly had to reset my expectations to find ANY solution. The only option that fit the bill was AlivePDF, an open source Actionscript 3 port of a PHP library. AlivePDF is maintained by Thibault Imbert.

AlivePDF comes with a SWC that you can include in your Flex application, or an Actionscript package you can import to your AS code. Here's a brief, condensed example of how I used AlivePDF in my Flash AIR project.

import org.alivepdf.*;

// setup pdf
var myPDF : PDF = new PDF ( Orientation.PORTRAIT, Unit.MM, Size.LETTER );

myPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );

myPDF.addPage();

// add a background image
myPDF.addImage (myBackgroundMovieClip, 1 , null, null, false, ImageFormat.JPG, 100, 0, 0, 0, 0);

// add headline
myPDF.textStyle ( new RGBColor ( 41, 58, 140 ) );
myPDF.setFont( FontFamily.HELVETICA, Style.BOLD );
myPDF.setFontSize ( 18 );
myPDF.setXY( 10, 40 );
myPDF.addMultiCell ( 300, 1, "This is my PDF Headline" );

// add text message
myPDF.textStyle ( new RGBColor ( 0, 0, 0 ) );
myPDF.setFont( FontFamily.HELVETICA, Style.BOLD );
myPDF.setFontSize ( 14 );
myPDF.setXY( 10, 50 );
myPDF.addMultiCell ( 300, 4, "This is my text….lots of text…" );

// save PDF to the desktop
var f : FileStream = new FileStream();
var file : File = File.desktopDirectory.resolvePath("MyPDF.pdf");
f.open( file, FileMode.WRITE);
var bytes : ByteArray = myPDF.savePDF(Method.LOCAL);
f.writeBytes(bytes);
f.close();     

Notice I'm using the method addMultiCell to add text. This may seem odd, but what this allows me to do is add a block of text that wordwraps. If I use addText then I only get a single line. 

AlivePDF is definitely still young and I've run into a few oddities (read bugs). I logged a bug on the Google project site and within no time at all received a note saying the issue had been resolved and would be released in the next build. Nice!

The Google project site provides a few examples in addition to the samples provided in the download. And the documentation is fairly helpful.

Note: Thibault just released 0.1.4.1, a minor revision the codebase I've been using at 0.1.4.0.  Hopefully this is a sign that the project is picking up some momentum! 

If you need to generate PDFs from your Flash, Flex, AIR applications using only AS 3.0, then this is your best (only) solution. 


Categories: FlashAIRPermalink

AIR Local Data Storage

Greg Hamer gave a fantastic presentation today as part of the Adobe Developer Week seminars on Local Data Storage Options with AIR. I think it's safe to say that Greg overprepared his material as it was run and gun from the start. If you like rapid fire learning, this is your guy.

Greg covered all the options available in AIR, demonstrated side by side read/write benchmarks for each, and discussed the pros/cons of each method so you can choose the most appropriate for your needs.

The four options available are:

1) Local Shared Objects
2) Encrypted Local Store
3) File System
4) Embedded SQL Database

Greg posted his slide deck, a link to his recorded session, and sample code on his site. It's well worth a look.


Categories: FlashAIRPermalink

Best AIR Overview Yet

I've been scouring the internet filling up my Google Reader with all the best AIR and Flash resources I can find. If you haven't yet discovered Lee Brimelow, point yourself immediately to The Flash Blog to check out his AIRConditioning presentation as well as his interview of Josh Bloom taking a peak at a new AIR app for Disney. Both are must see. Go, now.

Back? Now spend a couple hours on Lee's site gotoAndLearn() immersed in yummy, gooey knowledge.

Lee, we're going to get along just fine, you and I.


Categories: FlashAIRPermalink

About Time: Actionscript 2 to Actionscript 3

Took me long enough…but I finally have reason and motivation to do a project with AS3. And it is AIR that made that happen. I have 2 widget projects and 1 desktop application for different clients and all will be done in AIR which, of course, requires AS3. 

I could do them as Flash projector files, and use something like my old friend SWF Studio from Northcode to round out the features. But AIR it is.

Clients have and still do hedge on Flash Player 9 because of penetration stats. So, they opt for Flash Player 8, which as of today still appears to be the dominant player overall. While FP9/AS3 has offered a variety of compelling reasons for its use to me as a developer, it hasn’t been enough to motivate me to convince a client to go there.

There are a number of exhaustive migration articles and tutorials on moving to AS3. Shoot, books even. If, like me, you've been around since Flash4 and before, you'll probably skip the first half to 3/4 of most of these when they are covering what a timeline is and the basics of object oriented programming.

Here are some of my favorites:

Up next I'll post some of the challenges I had getting running and what I did to resolve them.


Categories: FlashAIRPermalink

Add a Comment