Tuesday, May 17, 2011

PatternCraft - Adapter Pattern

PatternCraft is a series of video tutorials which uses Starcraft references to teach Design Patterns. This tutorial covers the Adapter Pattern by showing how to add Mario and Sonic to Starcraft.

Monday, May 16, 2011

PatternCraft - The Differences Between the Bridge, State, and Strategy Patterns

I've already covered the state pattern and the strategy pattern, but many people find it difficult to distinguish between the two. I put this tutorial together to help highlight the differences. I also included the bridge pattern because, although it's not a "behavioral pattern", it's usage is very similar and helps show how different these patterns really are.

Thursday, May 05, 2011

Using Flex Formatter with IntelliJ

Flex Formatter is one of my favorite plugins for FlashBuilder, unfortunately there's no plugin version for IntelliJ.

But thanks to IntelliJ's "External Tools", you're able to use any tool that can be run from the command line (think apparat, sprouts, etc) and execute it with a keyboard shortcut within IntelliJ! The video below shows you how:




Running FlexFormatter from the Command Line:
http://sourceforge.net/apps/mediawiki/flexformatter/index.php?title=FormatterCommandLine

Download the files below:

FlexFormatterJars:
http://sourceforge.net/projects/flexformatter/files/flexformatter/0.8.4/FlexPrettyPrintCommand_0.8.4.zip/download

CommandLineSupportJars: http://sourceforge.net/projects/flexformatter/files/flexformatter/CommandLineSupportJars/commandLineSupportJars.zip/download

Sample Formatter.properties file:
https://github.com/as3/as3-utils/raw/master/res/flex-formatter.properties

Tuesday, March 29, 2011

Flixel on the iPad

Flixel is a popular library for creating Flash games (personally, I love it). So I was curious to see just how well it would run on an iPad with the new AIR 2.6 packager.

So I grabbed the source of Mode, threw it into my AIR for iOS tool (more info on that here), and grabbed the camcorder.

Honestly, I'm blown away by how well it ran. I didn't make any changes other than bumping up the resolution of the game to 1024x768 and changing the keyboard handlers to mouse handlers.

Watch below to judge for yourself:

Monday, March 21, 2011

Top 10 AIR 2.6 for iOS Questions

1. It takes forever to compile, am I doing something wrong?

Probably not. The compiler/packager/converter (whatever you want to call it) has to package up the entire Flash Player VM into your .ipa. So even if you're only compiling a single class, it’s still going to take a minute or two.

2. Why is my screen white?

That means you had a runtime error. Double check you’re not using RSLs or including an unsupported class (like ServerSocket).

3. Why can’t I install my .ipa on my device?

You’ve probably made a mistake with provisioning and setting up your cert to support your device. Follow the steps on the apple developer center carefully and make sure you’re using the correct target type (there are different builds for debugging, group testing, and app store).

(If your iDevice is jailbroken, you can get around most of the certification issues and transfer your .ipa wirelessly instead of using iTunes, but that's a discussion for another day)

4. Can I use p2p?

Yes!

5. Can I use ServerSocket?

No, but you can use Sockets.

6. What happened to “pfi” (packer for iPhone)?

It’s now built in to adt. So you now use adt to compile for everything: desktop, TV, Android, Apple devices, etc.

7. Can I use ANT to launch ADT?

Yes, make sure to build out your .swf first and then your packaging task will look something like this:

8. Is 2.6 really that much faster than 2.5?

Yes, it’s noticeably faster. You’ll still want to avoid complex filters and other intensive graphics though. Make sure to build a proof of concept before committing to anything.

9. What about the Amazon Market problems?

Read this: http://blogs.adobe.com/cantrell/archives/2011/03/air-2-6-applications-and-the-amazon-appstore-for-android.html

10. Anything else you want to tell me?

Yes, I recommend getting VERY familiar with “app-descriptors”. They’ll define everything from screen rotation to keyboards and from icons to app permissions. It’s all that “other” stuff you’re probably not used to worrying about.

Friday, March 18, 2011

PatternCraft - Abstract Factory Pattern - Part 1

PatternCraft is a series of video tutorials that use StarCraft references to teach Design Patterns.

Thursday, March 03, 2011

Non-Coding Development Tools

If you’ve met me, you know I talk a lot about IDEs (I currently rave about IntelliJ to everyone I know). But while I have my IDE open all day, there’s a completely different set of trusty tools* I rely on to take care of the “other stuff”. If you think I’m missing something or that I’m raving lunatic, please call me out on it in the comments. (I use Windows 7 as my primary OS, so I’m sure I’ve missed great mac/*nix tools out there)

 

Charles ($50 or less)

Charles is the savior of service inspection. If your app loads any data, then you need Charles to give you all the info you could ever want about what’s going on behind the magic curtain.

The feature set never ceases to amaze me: saving out all the load files, comparing two different services responses, redirecting requests to a different domain, etc, etc, etc. It’s really worth every penny.

 

SOS Max (Free)

Debugging and profiling are extremely important to any development process. But logging is the best way to find out what’s really “going on” in your app. FlashBuilder, FDT, Intellij, etc all have a “console” that can display traces if you’re already debugging, but SOS Max let’s you have all your logs display in a separate open window even if you’re not debugging. It even allows you to log Flash, Java, and PHP all in the same window and filter the logs based on regex.

 

 

Snagit ($50 or less)

Snagit makes the process of sending someone a screenshot awesome. If someone is asking me about a visual issue, I just hit “print screen”, select the screen/area/page I want to capture, use the Snagit editor to crop/add arrows/add notes, and then send as an email/ftp/whatever all in the fastest, easiest, and most powerful way I can imagine. I love tools that do their specific job well and I honestly think Snagit takes care of the screenshot process perfectly.

 

Firebug (Free)

Everyone already uses firebug already, right? Right.

 

 

 

Meazure (Free/Windows only)

Meazure is one of those old-school powerhouse tools that look like crap, but does exactly what it claims. This tiny tool will give you a complete overload of measuring information for anything on screen (which is a good thing) and also allows you to fine-tune your selection with zoom levels, rulers, grids, and the kitchen sink.

(I think meazure and Snagit should get married and give birth to a screenshot/measuring/visual info titan.)

 

 

Everything (Free/Windows only)

“Everything” is the ultimate windows search tool. It will instantly find any file on your hard drive and even let you use wildcards in your searches. I simply don’t use the regular Windows search anymore because this is so much better.

 

 

Vista Switcher (Free/Windows only)

Vista Switcher is just alt-tab, but waaaaaaaaaay better. (Ignore the “vista” part in the title, because it works perfectly on Win7 too)

 

 

 

Others

There are plenty of other awesome tools out there that I use, but only occasionally (I use the list above pretty much daily):  Notepad++, Cygwin, putty, AutoHotkey, winscp, Camtasia, and some others that I can’t think of right now ;)

*Intellij actually has great ftp/version control/etc and other plugins related to the “coding workflow”, so I don’t mention any of the alternatives here because I just don’t use them.

Monday, February 28, 2011

Quickstart for Molehill and Away3D

*NOTE* - this is a TEMPORARY patch to get you up and running as quick as possible. To stay up-to-date with the latest Flex SDK and Away3D releases, please follow their announcements.



1. Install the flash player 11 "incubator" runtime: http://labs.adobe.com/downloads/flashplatformruntimes_incubator.html

2. Download the following files:
Flex SDK 4.5.0.19786 (this is a link to a new page where you have to agree to terms, then download): http://opensource.adobe.com/wiki/display/flexsdk/download?build=4.5.0.19786&pkgtype=1
flashplayer_inc_playerglobal_022711.swc: http://download.macromedia.com/pub/labs/flashplatformruntimes/incubator/flashplayer_inc_playerglobal_022711.swc
molehill_away3d_patch.zip: http://j0hn.org/molehill/molehill_away3d_patch.zip

3. Extract the flex sdk
4. Copy/paste the flashplayer_inc_playerglobal_022711.swc into your sdk's framework/libs directory
5. Copy/paste the files from molehill_away3d_patch.zip into the sdk to overwrite the necessary files.

What is the patch doing?
The patch includes an away3d.swc, an updated flex-config.xml to always set -swf-version=13, and an updated index.html.template to always set wmode="direct"

Why should I patch the sdk?
This is only for molehill prerelease dev work to make the setup process a little easier. Adobe will eventually release an updated sdk and tools that will make this patch irrelevant.

Thursday, February 10, 2011

PatternCraft - Null Object Pattern - Part 1

PatternCraft is a series of video tutorials that use StarCraft references to teach Design Patterns.

Wednesday, February 09, 2011

Saturday, February 05, 2011

Friday, February 04, 2011

Thursday, February 03, 2011

Wednesday, February 02, 2011

How it Works - Robotlegs - Part 4

The "How it Works" video series explains how the inner details of popular libraries work so that you can use the same solutions in your own projects.

How it Works - Robotlegs - Part 3

The “How it Works” video series explains how the inner details of popular libraries work so that you can use the same solutions in your own projects.

Tuesday, February 01, 2011

Quick update

The "How it Works" series will focus on exploring the code in libraries you already know and love and breaking it down into tasty bite-size pieces. I'm tackling Robotlegs first (I've recently renamed the "Deep Dive" videos to "How it Works" videos, I'll probably save "Deep Dive" for more advanced uses of libraries) and then I'll move on from there.

Also, of note, this year I will be expanding my breadth of my tutorials beyond Flash to cover other web technologies as well. They will usually be based on what I'm currently working on at the time.

Lastly, you've probably noticed the last few videos are much shorter now. I've decided to break videos into more parts so that I can release them more often and focus on smaller pieces rather trying to push out 20+ minute videos out that you probably don't have time to watch.

PatternCraft - Chain of Responsibility - Part 1

PatternCraft is a series of video tutorials that use StarCraft references to teach Design Patterns.



Source available here: https://github.com/johnlindquist/johnlindquist.com/tree/master/ChainOfResponsibility-ATM

How it Works – Robotlegs – Part 2

The "How it Works" video series explains how the inner details of popular libraries work so that you can use the same solutions in your own projects.

Monday, January 31, 2011

How it Works – Robotlegs – Part 1

The "How it Works" video series explains how the inner details of popular libraries work so that you can use the same solutions in your own projects.