Category Archives: Blog

Adventures in Nonsensical Children’s Programming

Times have really changed since i was an ankle-biter. i reflect on this whenever my oldest daughter finishes watching her favourite kids’ show, and says “again! Again! i wanna watch it from the ‘ginning!” So i grab the PVR remote and rewind the show to its starting point. And when the six o’clock news comes on and her age-appropriate programming is finished, she simply says “Daddy, i wanna watch x,” inserting the name of whatever show she can think of, and lo and behold: we have at least ten episodes saved on the hard drive. i just queue it up, and she watches it.

Never mind what it was like when i was a kid. Never mind that whenever a show ended, i would start bawling my eyes out and my mother, from the next room, would say “new story coming, Ryan. New story coming.” And if i wanted to watch something and it wasn’t on right that minute, when the teevee gods deigned to air it, i just wouldn’t get to watch. It was The Beachcombers or nothing.

So while things have changed in that regard, kids’ teevee is just as screwed up as ever. i remain amazed that authors and other content creators continue to make the same bizarre decisions when it comes to realizing their worlds.


Take Franklin, for example. Based on the series of children’s books and toothlessly reproduced by Nelvana in their characteristically over-cautious style, the show chronicles the pedestrian adventures of an anthropomorphic turtle and his woodland friends.

Franklin's friends

Good news: you can bore your child to death on DVD, too.

So the turtle’s name is Franklin. What’s his bear friend’s name? It’s Bear. And the goose? Why, “Goose” of course. Beaver? His name is “Beaver”. It makes sense, doesn’t it?

No, it does not. It most absolutely does not. Why does the main character get a name, and none of the other animals do? What do you do if you need to introduce a second goose? What do you call it? “Goose”? “Goose Two”? “Also Goose”? You’d think this might have crossed the author’s mind, but i suppose that when crossing comeone’s mind means traversing a barren wasteland, not all thoughts make it to the other side.

Also on the long list of Nelvana shows that we switch off reflexively is Miss Spider’s Sunny Patch Friends. The characters are largely built from 3D primitives like spheres and … well, just spheres, really, presumably to match the look of the source material, a series of children’s books.

Miss Spider

The characters look like they’re built from pom-poms. Fine.

It’s all well and good until you catch a glimpse of the show’s villain, Spiderus, who looks exactly like this:


What in Technicolour f@#$ is this guy supposed to be? He’s a spider, just like any of them, but some artist went crazy with the nurbs modelling and trolled out this distrubing theatre mask and stuck eight legs on it. It just smacks to me of breaking your own rules – the rules you decided on when you were crafting your imaginary world. Either all the characters look stupid and are made out of spheres with inexplicably yellow eyeballs, or all the characters have nightmarish Punch and Judy masks for faces. Take a stand, author.

No world is more guilty of breaking its own rules than the Mickey Mouse universe, where all of the animals walk around in varying degrees of dress, except Pluto the dog, who romps around naked on all fours and can’t speak like the rest of them.

Mickey Mouse and Friends

Numerous observational comics have pointed this out over the years, asking why Goofy gets to wear pants and drive a car, while Pluto is fed dog bones and wears a collar. The most common defense that i’ve heard is that Goofy’s not a dog – he’s a goof. That doesn’t explain what Pete is. And anyway, it’s not a very strong defense. Regardless of Goofy’s nebulous origins, it remains a fact that only select members of the animal kingdom are fit in Disney’s mind to walk upright and do people things, and it’s always struck me as unfair.

Word World

The injustice continues even today with shows like Word World, which is too awesome to hate, but which presents enough niggling little problems that i’m mildly annoyed whenever it comes on. Here again, you’ve got a walking-talking Pig, Bear, Frog, Sheep, Ant, Bug and Fly, but the dog acts like a dog, barking and walking on all fours. BUT he someone has his own house and lives alone. AND when they put someone in a real-life Dog costume, the character walks upright:

Word World Dog Costume

I’m getting confused …

AND all of the animals are named after their species, a la Franklin. And while i’m getting this all off my chest, Frog’s voice work is too close to Kermit for comfort, which has always bothered me. And in the show, when you put letters together, they form the shapes of the things they spell … BUT the shutters and window in Dog’s room spell “D-O-G”, but they don’t take the shape of a dog – they take the shape of a window and shutters.

AND, now that i’m on it, if i lived in Word World, i think i’d just gather up all the letters to spell “S-E-R-I-O-U-S B-L-I-N-G” and “B-A-R-E-L-Y L-E-G-A-L T-R-O-P-H-Y W-I-F-E” and call it a day. But i guess that’s the distinction between a show for preschoolers and a show for Daddy.


The whole Pluto Dichotomy rears its ugly head in another popular kids’ show, Arthur. i don’t have many negative things to say about Arthur, because it’s one of the most truly excellent shows in the pantheon of children’s entertainment. But once again, we have an anthrophomorphic animal living in a world full of anthropomorphic animals, and here’s the main character holding a puppy.

One last thing, while i’m on it. This is what an aardvark looks like:


Round head? Nope. Rounded ears? Er … nope. Subtle snout? No sir. (note: i’m reading up on it as i write this, and apparently author Marc Brown started out drawing Arthur with a long snout, which has subsided over the years. Kind of like how Mickey used to look like a white guy in blackface.)

My mom came over to look after the girls one day, and Arthur was on. She watched it for two minutes before wincing and saying “what animal is that kid supposed to be?” i told her he was an aardvark, and my mom scrunched up her face and said “no … no, i don’t think so.”

And here’s what sets Arthur apart from all the other kids’ shows on the tube: in one episode, the Arthur characters are watching a show on their teevee, which was a parody of Arthur. And one of the characters says “What’s that kid supposed to be? A mouse?” Another kid chimes in “And why does he have a dog?” And another: “What do they serve in the school cafeteria – tree bark and garbage?”

Bravo, folks. Bravo.

When Logic Goes Out the Windows®

Some days, computers are like George Milton from Steibeck’s Of Mice and Men, ushering little old me through a brave new world of terrifying technology that i scarcely understand. Other days, computers are like Lennie Small, the idiot man-child who just wants to stroke things that’s soft.

This morning, we tried to create a 301 redirect to fire traffic to i hit the non-www address in Internet Explorer, and the browser decided it would be a good helper and pop up this message:


Wait … what?

Apparently, Microsoft hired Douglas Adams to write a few of their warning prompts before he died.

One Step Forward, Nine Miles Back

If you’ve been following along at home, you’ll know that we’ve been ramping up to iPhone development for the past – oh, six months or so. We bought an iMacBookUnibodyPowerProMini, or whatever the Hell it’s called. i dunno. It’s white. We picked up an iPod Touch. We took an “iPhone for Flash Developers” course. We bought into the Apple iPhone Developer Program, and were approved.

No Cavities

We’re still waiting for Apple to send our Secret Decoder Ring.

We’ve been building Kahoots™, our fun crime-themed puzzle game (which we’ve modeled entirely in clay) to the iPhone/iPod Touch screen spec, which is approximately 478 x effin’ tiny. i even went out and got one of those Apple tattoos, because that’s supposed to count for something. The one thing we haven’t done is to actually learn Objective-C and deploy something to the iPhone. Pfft. A minor detail.

With every step i take towards learning this new (to me) technology, it feels like a wall erupts out of the ground and up into my face:

  1. An industry pal told me that the CoreAnimation libraries for the iPhone were very, very slow, and that even the simplest game slowed to a crawl. i would need to learn to program in openGL-ES.
  2. Terrified by the prospect of having to learn the square bracket-crazy OBJ-C and openGL-ES (whatever THAT was), i was seduced by the apparent C#/javascript-based simplicity of Unity3D, a game engine for creating browser-based and iPhone games
  3. While evaluating Unity, every time i tried to access the software’s online documentation, their website was down
  4. With Unity’s site proving unreliable, i resolved again to learn OBJ-C
  5. At a recent iPhone developers meeting here in Toronto, devs told me that OBJ-C is mixed in with C++, so i should learn C++ while i’m at it
  6. At the same meeting, other devs mentioned that the whole thing is hung on C. Now i was faced with the prospect of learning Objective-C, C++, C and openGL-ES (whatever THAT was)

Fine. If that was my lot in life, then so be it. i’m not a stupid guy. i can learn things, like words and junk. And sometimes stuff. Sometimes i can learn stuff. And i wanted to program things for the iPhone, so if i had to learn four new languages in my off-hours, i was prepared to do that.

Midnight Oil

If “burning the Midnight Oil” refers to setting this guy on fire, i’m all for it.

Free Smarts from the Stanf’

Fellow devs mentioned repeatedly that i could audit a new publicly-available Stanford iPhone development course. The lectures are all recorded and posted for free on iTunes, and the assignments are all available online. Great! And the only pre-requisite was familiarity with Object-Oriented Programming, which i have under my belt since learning ActionScript 3 this past year. So off i went.

i watched the first two lectures, and then turned my attention to the assignments. Assignment #1a had me dragging things around the screen and breathing with my mouth open. No problem. i sailed right through it.

Assignment #1b asked me to write a few methods. Okay … no biggie. i know what a method is. i just didn’t know the OBJ-C format for writing a method. i know it starts with a minus sign, and you put the return type in there first, or some junk …

Assignment #1b asked me to open the documentation. So i did. Assignment #1b wanted me to look up the path-finding method for an NSString. i wanted to know how to write a method first. So i searched “method”. And then “method structure.” Nothing. Of course not – language references don’t exist to tell you how to build a car, or even to provide pictures of what a finished car looks like. They’re just encyclopedias of nuts and bolts you’ve never heard of.

Nuts and Bolts

I wouldn’t exactly say i “admire” people who can learn this way. “Fear them” is more like it.

To Google!

i started looking up OBJ-C code examples. Everything i found was needlessly complex. i just wanted the basic structure for a basic method with no arguments and no return types, and Google was all “but then you can flim-wang your fozzbuster!” And i was all “no thanks, Google! Just passing through.” And then i backed away slowly, trying not to make any sudden movements.

What was my last resort for help, short of asking my 60+-year-old mother for programming advice?


Internet Relay Chat is a magical place filled with verbally-abusive and generally terrible people who will sometimes help you with your problems if you appeal to their supposedly superior intellect and delusions of grandeur. i asked some folks in a related channel if they could refer me to a clean code example that would show me how to write a function. They copy/pasted exactly what i had written in XCode, which was throwing me errors.

One IRC person said that knowledge of OBJ-C was a pre-req for the Stanford course. i respectfully disagreed: the course syllabus only required a knowledge of Object Oriented Programming. Then he said something unkind about my 60+-year-old mother. i won’t repeat it.

Another person suggested that i go through Apple’s tutorial. So off i went to the Apple Developer Site, and found the Your First iPhone Application tutorial. Now i was getting somewhere!

“First” Apparently Has a Number of Meanings

The preamble to the tutorial mentioned that i should have both Objective-C knowledge AND Object-Oriented Programming knowledge before proceeding. It linked me to two different whitepapers. Somewhat afeared, i decided to take Apple’s advice and read up. One of the links was broken. Almost completely out of options by this point, i started in on the other link:Object-Oriented Programming with Objective-C”.

i made it about 3/4 of the way down the page before looking around to see if i was on hidden camera or something. If this was it – if THIS was the most basic, square-one starting point that Apple recommended for someone in their iPhone Developer Program, then clearly i’d have to think about evolving into a new species so i could fly off of this planet and nuke the site from orbit.

Here’s a taste of what the whitepaper offered:

A programming language can be judged by the kinds of abstractions that it enables you to encode. You shouldn’t be distracted by extraneous matters or forced to express yourself using a vocabulary that doesn’t match the reality you’re trying to capture.

i read that sentence, and then i noticed a little feedback box at the bottom of the page. It asked “Hey. How ya doin? Are you digging the article so far? Hey? Has it met your needs, kiddo? If not, click here.”

i clicked so hard on that button that i dented my web browser.

What followed was somewhat of a tirade. The feedback went something like:

Are you serious? Did you guys proofread this before publishing it? It sounds like it was written by Little Lord Fauntleroy.

Little Lord Fauntleroy

Oh, yes! (clap clap clap) Let us code for the iPhone forthwith, mummy! That would be resplendent!

i called the whitepaper heady and pretentious. And then, for good measure, i threw in something about Apple’s 60+-year-old-mother. That bit was fresh in my mind already.

But if this is the starting point, this is the starting point. Apparently, against my best wishes and hope for my own sanity, i somehow need to learn three new programming languages across two paradigms in reverse order of development AND openGL-ES (whatever THAT is) if i want to build games for the iPhone … which i do, because i’ve heard you can make like NINETY MILLION DOLLARS on a FART APP.

Or i can save myself some pain and suffering and eat a chimichanga. (** FRAAAPP! **) Ninety million dollars please?

Tutorial: Twitter Updates in Flash Part 2

Our first tutorial, Pull Twitter Updates into Flash, got us a bit of attention. So rather than write an entirely new tutorial, we thought we’d beat a dead horse a little and re-hash some of the same material.


We’re even using the same Fwitter logo. Classy.

This tutorial builds on the last one, and helps us solve an important problem. Untold Entertainment member and friend of the site MichaelJW pointed out last time around that Twitter only allows you to make 100 calls per hour for a given user name. If you’re fabulously swamped with oodles of traffic, or you’re like me, suffering from delusions that you will one day be fabulously swamped with oodles of traffic, then this is a problem. Fortunately, MichaelJW has the solution: simply write to Twitter and ask to be whitelisted, so that you can make all the calls you want!

In short order, you’ll receive this letter from Twitter:

From: Twitter
Subject: Your Request for Twitter API whitelisting has been rejected

Hi Ryan Creighton,
Thanks for requesting to be on Twitter’s API whitelist. Unfortunately, we’ve rejected your request.
Here’s why:
Please investigate other strategies to stay within our rate limits:
Please address the issues above and submit another request if appropriate.
The Twitter API Team

CrapDAMMIT. That means we’re actually going to have to do some work to overcome this problem. Aww … i hate things that are hard.

Cold Hard Cache

i don’t know what you’re up to,but i thought this Twitter module idea was pretty cool, so i stuck it at the top of my website in the global nav. That means that every time the page is refreshed, we hit Twitter for a new copy of the tweets. Also, God kills a kitten or whatever. So that’s not being a very good netizen. Why hammer Twitter with more requests than necessary when we can spend hours of our own time writing a caching script to solve the problem? Am i right?

So here’s what we’re gonna do, in pseudocode:

  1. When we load up the module, let’s check the user’s Flash cookie to see if we’ve saved any Twitter data
  2. If the cookie is empty, we’ll hit the Twitter servers and grab new data. Then we’ll save that data for next time.
  3. We’ll add a time stamp to the Flash cookie so we know how long it’s been since we grabbed fresh data from Twitter.
  4. If there IS Twitter data in the cookie, let’s look at how old it is
  5. If it’s still fresh, there’s no need to hit Twitter. We’ll just display that data.
  6. If it’s old data, let’s hit Twitter and get a new copy.

(note throughout the tutorial and the code, i use the vernacular “Flash cookie”. The proper term is “shared object”, but it’s a lot harder to remember what the thing does when you call it that.)

How do we know what constitutes “old” data? It’s right there in the code. You can set the number of hours, minutes and seconds it takes for the data to expire. i think setting the expiry to 1 hour is pretty reasonable, but feel free to be as unreasonable as you like with this value. It’s your Twitter funeral.

Here comes the code:

	 *  This fun Twitter widget is brough to you
	 *  by Untold Entertainment Inc, and 
	 *  peanut butter!  Peanut butter: a gooey,
	 *  yummy snack that might kill you.
	// Here are all the goodies you're going to need 
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	public class Main extends MovieClip
		private var twitterXML:XML; // This holds the xml data
		private var cachedTwitterData:SharedObject; // This stores the data loaded from the Flash cookie
		private var twitterPHPScriptPath:String;
		private var myTwitterID:String;
		private var wereAllowedToWriteToTheFlashCookie:Boolean; // You can use this value to decide whether or not to make repeated save attempts
		public function Main()
			// Put your Twitter username here.  For example, ours is "untoldEnt" :
			myTwitterID = "myTwitterID"; 
			// Put the path to your php script here:
			twitterPHPScriptPath = "";
			wereAllowedToWriteToTheFlashCookie = true; // (let's be optimistic until we discover otherwise) 
			// Check to see if the user has already retrieved the Twitter updates and stored them in a Flash cookie:
		private function loadTwitterDataFromFlashCookie():void
			// Call up the Twitter data from the Flash cookie on the user's machine:
			cachedTwitterData = SharedObject.getLocal("twitter");

			var timeStamp:Date =;
			if (timeStamp != null)
				// The timeStamp variable is in there, which means we've retrieved Twitter info for this user at some point.
				// Now let's check the timeStamp. If the last time we grabbed Twitter data was too long ago, let's grab fresh info:
				if (hasExpired(timeStamp))
					// The most recent copy of the Twitter data in the Flash cookie is old!  Let's get some fresh data:
					trace("cookie has expired!  let's get some fresh data");
				} else {
					// It hasn't been very long since we grabbed a fresh copy of the Twitter data. Let's just use what we've got in the Flash cookie:
					trace("cookie is fresh. display the data.");
					twitterXML =;
			} else {
				// If there's no timeStamp variable in there, then the cookie's empty.  We need to hit Twitter to grab our data for the first time.
		private function saveTwitterDataToFlashCookie():void

			// This bit tries to write something to the user's Flash cookie. Depending on the user's Flash cookie
			// settings, we may need to ask the user permission before we write to the cookie.  We'll test
			// the water by trying to write something to the cookie:
            var flushStatus:String = null;
                flushStatus = cachedTwitterData.flush(10000);
            } catch (error:Error) {
                trace("Error...Could not write SharedObject to disk\n");
			// If we were able to write to the Flash cookie, let's see if the user was prompted to allow us or not:
            if (flushStatus != null)
                switch (flushStatus)
					// The user is only allowing us to write a very small amount of data to the Flash cookie, and has asked
					// Flash to prompt him so that he can give permission to write something larger.  Let's wait until the
					// user clicks to give that permission:
                    case SharedObjectFlushStatus.PENDING:
                        trace("Requesting permission to save object...\n");
                        cachedTwitterData.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
					// We're home-free: we can write to the cookie, and the amount of data is small enough to fly under the
					// user's Flash cookie permission radar.  Let's write some data!
                    case SharedObjectFlushStatus.FLUSHED:
                        //trace("Value flushed to disk.\n");
						trace("********* save complete. ***********\n");
		private function onFlushStatus(e:NetStatusEvent):void
            trace("User closed permission dialog...\n");
            switch (
                case "SharedObject.Flush.Success":
                    trace("User granted permission -- value saved.\n");
				// Dammit!  In this case, the user freaked out and won't let us write anything to his Flash cookie.
				// We'll have to hit Twitter every single time solely for this user's benefit.
                case "SharedObject.Flush.Failed":
                    trace("User denied permission -- value not saved.\n");
					wereAllowedToWriteToTheFlashCookie = false;
            cachedTwitterData.removeEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
		private function finishedHandlingTwitterData(e:Event = null):void
			trace("Twitter data saved.");

		private function hasExpired(timeStamp:Date):Boolean
			// Store the date RIGHT NOW, to compare against the Flash cookie timeStamp:
			var now:Date = new Date();

			// Let's say that the cookie expires after 1 hour, 0 minutes and zero seconds:
			var expiryHours:Number = 1;
			var expiryMinutes:Number = 0;
			var expirySeconds:Number = 0;
			// Store some handy conversion values:
			var msPerHour:Number = 3600000;
			var msPerMinute:Number = 60000;
			var msPerSecond:Number = 1000;
			// Multiply those values to get the expiry time in milliseconds:
			var expiryTime:Number = (expiryHours * msPerHour) + (expiryMinutes * msPerMinute) + (expirySeconds * msPerSecond);
			// Return whether or not the timeStamp is past the expiry date:
			return (now.getTime() - timeStamp.getTime() > expiryTime)
		private function loadTwitterXML():void
			var urlLoader:URLLoader = new URLLoader();
			// When all the junk has been pulled in from the url, we'll fire finishedLoadingXML:
			urlLoader.addEventListener(Event.COMPLETE, finishLoadingXML);
			urlLoader.load(new URLRequest(twitterPHPScriptPath + "?twitterId=" + myTwitterID));			
		private function finishLoadingXML(e:Event = null):void
			// All the junk has been pulled in from the xml!  Hooray!
			// Remove the eventListener as a bit of housecleaning:, finishLoadingXML);
			// Populate the xml object with the xml data:
			twitterXML = new XML(;

			cachedTwitterData = SharedObject.getLocal("twitter");
			// Set the date/time RIGHT NOW: = new Date();
			// Store the twitterXML data: = twitterXML;	
			// (Try to) save the whole shebang the user's Flash cookie: 
		private function showTwitterStatus():void
			// Uncomment these lines if you want to see all the fun stuff Twitter sends you:
			// Prep the text field to hold our latest Twitter update:
			twitter_txt.wordWrap = true;
			twitter_txt.autoSize = TextFieldAutoSize.LEFT;
			// Populate the text field with the first element in the status.text nodes:
			twitter_txt.htmlText = twitterXML.status.text[0];

This is just a modified version of the code we used last time, with the caching stuff added in. It’s very well commented. If you’re new to the concept of Flash cookies, take a careful read-through and make yourself smart.

I Did it All for the Cookie

Cookie Monster

Now DAT a lot of code.

i added one flag to the code called wereAllowedToWriteToTheFlashCookie. Time was, no one knew about Flash cookies, and you could get away with murder. Nowadays, some folks are wise to the fact that Flash can store stuff to their computers, and they’re blocking access, or cranking the permission slider down so that barely any data can be stored to their computers. If this is the case, and you try to store a Flash cookie, a dialogue box will pop up and ask the user to authorize the cookie-writing procedure. If the player says “no”, we’re flagging the wereAllowedToWriteToTheFlashCookie to false.

This tutorial doesn’t really make any further use of that value. But if you check out our super-deluxe version of this module at the top of the Untold Entertainment site, you’ll notice we added paging controls so that users can flip through the last twenty Twitter messages, and an auto-refresh countdown that displays the next tweet automatically. One of the things i noticed was that if you move around the site quickly, the bird keeps tweeting the most recent post. That’s kind of boring.

What i’d like to do (which i may have already done, depending on when you read this), is to save the currentTweet number every time it changes. That way, when the page refreshes, i can retrieve the currentTweet number from the Flash cookie and pick up where i left off. BUT if the user isn’t allowing Flash cookies, he’s gonna see that “Allow?” dialogue pop up every time i try to save the currentTweet number. And that stinks. That guy’s not likely to pay a repeat visit.

So i’ll check the wereAllowedToWriteToTheFlashCookie flag before i try to save anything else to the Flash cookie.

And by then, the Twitter module on our site will be just about as awesomazing as possible.

Making it Work

If this is your first time with these Twitter tutorials, you might make some mistakes. And then you might blame those mistakes on us. Rest assured, the code works. You’re probably doing something silly. Make sure you test this on a web server, because the Flash IDE lies to you, and generally won’t tell you when there’s a securty sandbox issue. Please check the comments at the bottom of these posts to make sure you’re not making the same mistake that someone else has made before you. We’re not that great at troubleshooting this stuff, because we’re usually too busy chasing after the next shiny object to pay proper attention to you. When in doubt, use the boards to discuss. By signing up on our boards, you get the added benefit of being awesome.

You can download the source code for this tutorial here:

For more Flash AS3 Tutorials and a pile of other useful stuff, check out our Flash and Actionscript 911 feature.