»
S
I
D
E
B
A
R
«
Batch SWF Conversion with AIR and Illustrator CS4
Jul 16th, 2009 by Richard Bates

Something that comes up pretty often for me as a Flex developer is the need to have artwork in SWF format.  For instance, I am working on a graphics app right now and I wanted to include vector clipart. I have loads of it, but its all in Illustrator (.ai) or PostScript (.eps) format.  The easiest way to deal with these formats is in Illustrator.  But they need to be SWFs for maximum benefit in my AIR app. Opening them and exporting to SWF one-at-a-time is totally unreasonable, as I have about 350 files I want to use. So, I started trying to think of a way to script Illustrator to convert them.  I remembered seeing something to allow interaction between AIR apps and CS3/4 apps on Adobe Labs.  After some Googling, I was able to locate Switchboard.  Basically, Switchboard allows you to call ExtendScript scripts from AIR applications.  Now, I have never used ExtendScript before, but I did manage to find a sample script called ExportFilesToSWF (installed with Illustrator CS4), which provided a good starting point.  The script is actually JavaScript, so before long, I had customized it to my needs.  The cool part is that Illustrator can convert a dozen formats including MS Word to SWF.  So, with a little ActionScript, I was able to create an AIR application that converts all the files in a directory to SWF using Illustrator.  You can choose the source document formats you want converted in the AIR app UI.  The resulting SWFs are saved to a “/converted” subfolder of the source directory.  I have not tried this on Windows, but it should be OK.  Please let me know if there are issues and I will post a fix.  To restate the obvious, you MUST have Illustrator installed for this to work.  You must also install SwitchBoard for end-users so the AIR application can communicate with your Illustrator installation.

AIBatchConvert - AIR Installer (Converts to SWF ONLY! I’ll add more scripts as requested)

MasterClass! Released
Jul 9th, 2009 by Richard Bates

My VTC MasterClass! titled ActionScript 3 & Payment Gateway APIs is now available at VTC.com.  In this course, I go over creating custom ActionScript classes for interacting with the APIs from Authorize.net and PayPal.  The code you create in the course will be portable and reusable, so at the end of the course you’ll have custom AS3 classes for both payment processors.  In addition to the ActionScript, I also show you how to use PayPal Pro’s Direct Payment API and a PHP proxy script for more advanced functionality from your Flash-based applications.  Please check it out and let me know what you think!

Windows 7 Initial Thoughts
Jul 6th, 2009 by Richard Bates

I’m going to keep this brief, as there will no doubt be other better, more exhaustive reviews out there, but I wanted to just give some impressions from the perspective of a developer.  Developers have a unique set of needs from an OS, the most important of which, in my opinion, is “does it stay out of my way while I’m trying to do my job?”  OS X does.  Windows XP (kind of) does.  Vista does the opposite with religious zeal.  So, how does 7 fare?

In a word: well.  It is noticeably faster than Vista, both on boot and in normal operation.  The visual effects are snappy and nice, even on an integrated Intel 3100.  I have it running on an old Dell Vostro 1500 with 1.4Ghz C2D and 3GB of DDR2.  Vista made this machine look like a limping clunker, but 7’s performance is almost as good as XP.

Should you switch from Mac to Windows now that 7 is on its way? No.  I’m certainly not going to.  But if you are still in MS bondage, a move to Windows 7 might just save you from Vista hell.  In short, Windows 7 is what Vista should have been.  Its still Windows, but its less likely to trigger a homicidal rampage.

AIR and PHP Development Course Now Available!
Jun 16th, 2009 by Richard Bates

I am pleased to inform everyone that my VTC course titled “AIR and PHP Development” is now online!  Please take a look at the free videos and course outline available at VTC.com.  My approach to this course was to walk the viewer through the real-world work of Flex/AIR and PHP development, and the most important goal I have for this course is for you to walk away with new, marketable development skills. One thing I would like to stress is that this course is not just for AIR and PHP development, but also Flex and PHP development.  Many of the code examples and applications can apply to Flex or AIR, and all AIR development is done using Flex Builder and the Flex SDK.

I would like to add a special ‘thank you’ to John Mangino, my project manager at VTC.  He really is an advocate for developers (and a talented developer in his own right).  Thanks in large part to his efforts, VTC’s development courses provide an inexpensive way for developers to gain valuable, in-demand skills and knowledge.

Please contact me if you have any questions about the course!

Flash and PHP Development Center Online
May 22nd, 2009 by Richard Bates

In an effort to spread as much information as possible on Flash Platform and PHP integration around the Web, I have created the Flash and PHP Development Center.  The URL (flashandphp.com) should be easy enough to remember. And yes, I used the Ahimsa theme there as well because its good and I’m lazy. I have created a few video tutorials to get the site started, and all are available in glorious HD on the high-speed Mosso CDN.  You can also save me a few pennies by viewing them on Vimeo.

I plan to add a lot more over time, but more importantly, I’m hoping to get some help from you.  If you are a developer and have the ability to write articles or do screencasts, please contact me about it.  I would really love to have videos from a wide variety of perspectives.  Besides, you can probably do a better job than I can.  So please don’t hold back.  For those of you who are busy, I would definitely recommend the screencast route.

I will be contacting (read: begging) some of the developers I know and asking them to lend their expertise as well.  To help along in that effort, please hit the blogs of community experts and post comments telling them you want to see them in action on flashandphp.com!

Get Ready: MasterClass! Coming
May 20th, 2009 by Richard Bates

A huge portion of my work involves using 3rd-party payment gateways with Flex applications.  Its always a pain for me to recreate the code to hook up with Authorize.net or PayPal.  Well, it used to be.  I created ActionScript classes to deal with these APIs.  For example, all you have to do to send someone from your Flex app to Authorize.net is to call:

AS3Authorize(54.45);

Where the passed-in value is the amount of your transaction.  The class takes care of the rest, with a little help from as3corelib’s crypto package.  I’m going to walk through the creation of AS3Authorize and a whole lot more in a new VTC MasterClass! on using payment gateway APIs from Flash Platform Apps.  It should be published in a few weeks, and of course I’ll announce that here.

New Style for flexandair.com
May 20th, 2009 by Richard Bates

Those of you who are return visitors will notice the very different look I implemented today.  I saw this theme, called Ahimsa, on the WordPress site and I thought it was great.  Big thanks to Ravi Sarma.  I especially like the collapsible sidebar and the links across the top.  Let me know what you think of the new theme!

Second That
May 19th, 2009 by Richard Bates

If you aren’t on board with getMicrophone(), you really should check it out.  Its a community effort to get Adobe to include full access to the microphone’s raw audio stream in Flash apps.  I have always found Adobe and their developers to be responsive and open to community input, so its important that we developers keep up the noise to get this done. Another thing you can do to support this effort is to post your video response on YouTube.  Many of you have already heard all this from Wade Arnold, but he’s right again and it bears repeating.

Blazing Fast on a Budget
May 19th, 2009 by Richard Bates

If you have normal web hosting needs, you probably have a PHP-based website with a MySQL database containing your site content.  You probably also have a bunch of images and maybe some video or a podcast.  If you’re like me, you’re thinking “Surely there’s a cheap way to host the MySQL and HTML.”  You’re right.  Hostmonster is awesome for this purpose, and they host the flexandair blog for $75 per year.  Unlimited transfer, unlimited storage.  How sweet it is.  But when it comes down to brass tacks, the bandwidth just isn’t there.  For larger images, audio, and video, the performance is really kind of frustrating sometimes.  And that is to be expected from a budget host.  For a blog, I’d say “thats life” and move on.  But if you’re running a business, you can’t afford that kind of embarrassment.  But does that mean you have to get a (decent) VPS, or even a dedicated machine?  No.

Break the problem into 2 parts:

PROBLEM 1: I need a cheap way to pull text-based information (HTML, plain text, configuration, links, all that stuff in your MySQL DB).  ANSWER: Hostmonster/GoDaddy/BlueHost is cheap and their servers are killer machines that will rip through your “SELECT `dainty` FROM `little_db` WHERE `info` = ‘noproblem’”.

PROBLEM 2: I need binary files (images, archives, audio, video) to be straight-up blasted to my visitors. I want to crush their faces with a hobnail boot of media.  ANSWER: Cloud, baby.  In my opinion, the cloud is best used like a sledge hammer.  Don’t run an Amazon EC2 instance 24×7 to serve your latest corporate tweets.  Thats $80 per month for…what?  Use a storage cloud.  Using an enterprise storage cloud service will give you access to the carotid artery of the Internet for about 15 cents per gigabyte.  I prefer Mosso to Amazon because they have put forth a lot of effort in developing their APIs and documentation.  The customer service is awesome, and uploads using their management console are free.  Using Mosso puts your files on the LimeLight CDN, and it is fast, fast, fast.  If you’re using a CMS like Joomla! or Drupal, move your logo and template background image to the cloud, and change your links.  Then, move all your images, audio, and video over there too.  It couldn’t be easier with Mosso’s file manager.  You just upload like you would in any webmail account, and they give you a URL where you can access your file on the CDN.  It is a “container” in a subdomain, like Amazon.  Boom.  You’ll be amazed at the speed.  And the bill will probably be less than 30 cents.

$10 per month VPS
May 16th, 2009 by Richard Bates

OK, so you can actually get the basic VPS from WebKeepers for $6.95, but thats if you buy a year in advance.  If you’re like me, you aren’t about to shell out for a year without putting the product to the test.  When I signed up for Webkeepers, I looked for an honest review on their service.  I didn’t find one.  So, I wanted to put in my 2 cents on them.

WebKeepers is awesome.  The price, month-to-month, is $10.  You guys may have already used WebKeepers, because all of my pdf2swf conversions take place on my super-cheap VPS.  I have had some downtime, but every time that happens, I get a prompt email from WebKeepers, and the problem is fixed in a hurry.  So, its a great value for $10.  If you have been wanting to run something super cool but couldn’t because your host wouldn’t let you, I would definitely recommend a VPS from WebKeepers.  I don’t know how well they would scale for more serious purposes, but for doing development work and publishing demos, its great.

»  Substance: WordPress   »  Style: Ahren Ahimsa
© 2008-2009 Richard Bates