Guess what my favorite ActionScript error is?

July 14th, 2008

Why, it's good old Error #1009!

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Information/setup()
at Interface/setup()
at Document/::setup()
at Document$iinit()

All it would take to make this okay is the name of the null object. It's obviously been declared, but not instantiated. I can't imagine that Adobe was just too lazy to toss the name in there, since, for the most part, the errors provided are very helpful.

I will admit that I'm a bit of a novice with error handling. Is there a way to make this situation better? Leave a comment.

AT&T + Apple = Bad Apple

July 1st, 2008

There's been much hullabaloo over the JesusPhone 2.0 since its announcement. As far as I can see, most people are relatively excited about it. Apple has apparently managed to incorporate 3G and GPS without a significant hit to battery life.

However, there's also been some criticism about the price. At the WWDC keynote at which the iPhone 3G was announced, El Capitan Jobs listed 5 major improvements of the new iPhone: 3G data speeds, Enterprise support, third party applications, availability in more countries, and last but not least, more affordable. Jobs announced that the new iPhone would sell for $199 for the 8GB model and $299 for the 16GB model. The crowd of course goes nuts.

The problem is that it's not more affordable. It's less affordable. AT&T decided that unlimited data for the 3G iPhone was going to cost $30/month, which is $10 more per month than the original plan. Stretch that out over 2 years and you've paid $40 more for your iPhone 3G than the original. The math goes like this:

$20/month (iPhone) * 24 months = $480

$30/month (iPhone 3G) * 24 months = $720

$720 - $480 = $240

Factor in the $200 price drop in the new iPhone and you're still paying $40 more over 2 years for the new iPhone. So completely overlooking the fact that this is supposed to be a major selling point for the new iPhone, you might say, "But Chris, surely GPS, 3G, 3rd party apps, etc. is all worth this $40 premium." To which I might say, "Yes. I suppose I agree." However, there's more. Today, AT&T announced the official pricing and plans for the new iPhone. Take a look here and here. Essentially what it says is that you only get the price announced at WWDC if you are eligible for an upgrade. I talked to an AT&T representative on the phone and was quoted a 20-month time frame from your last upgrade. Have you perhaps casually gotten a new phone because you weren't happy with your last one? No cheap iPhone for you. There are any number of scenarios in which you are suddenly ineligible for this fabulous selling point that Jobs felt the need to announce at WWDC. You'll have to pay the price of the previous iPhone ($399/$499). Did I mention you still have to get a 2-year contract? The only upside I can see is that, according to Engadget's post, previous iPhone owners get the discounted price.

BUT WAIT! There's more! Did you want to buy that iPhone without activating it, as you could with the first iPhone? You get to pay even more than the previous iPhone cost! Yayyyyyy! Get ready to plunk down $599/$699 for the new hotness. Wait, isn't that more than the first iPhone EVER cost EVER?

So way to go, Apple. I don't know what the fuck happened, but next time I suggest you wear a cup so AT&T doesn't have the chance to get the vice grip on your balls that I can only imagine they must have. I don't even know how to put into words how weasely this is. I expect better from Apple.

Let me sum up this monster of a post in this sentence: The iPhone 3G is in no way cheaper than the original iPhone, in spite of what was announced at WWDC, and what is clearly supposed to be a selling point.

Bad! Bad bad!

Puzzle Farter - Trifecta!

June 19th, 2008

Joe Schmitt turned me onto Puzzle Farter, a game by Pet Tomato. I'm constantly on the look out for silly Flash games that will keep me occupied. More often than not, I'm disappointed by poor gameplay mechanics, lackluster design and/or one-shot gimmicks that quickly become tiresome.

Puzzle Farter, on the other hand, hits a trifecta:

  1. Simple Gameplay/Easy Learning Curve
    The controls for this game could not be simpler. Up, down, left and right to move, and another tap/hold of up to use your special power (spoiler: it's a fart-powered butt-boost). The first couple of levels are very simple and let you get hold of these controls, which are very elegant in their own way. Too often simple gameplay mechanics are marred by lack of fine tuning. Puzzle Farter hits the sweet spot with its simple physics.
  2. Pleasant Graphics
    It looks good! Much like the gameplay, the graphics are a simpler 16-bit style throwback, and it couldn't be more appropriate. It doesn't have the flash-bang of modern 3D console games, but I've always thought that just because you can make a game that has particle effects and 3D tricks out the ass doesn't mean you should. I long for the days of the good 2D side-scroller.
  3. The Human Connection
    This is easily the most important of the three. A game won't hold water with anyone if they can't relate to it. I immediately thought of no less than 10 people to send this to ("Hey, I found a game that reminds me of you!"). Even the corniest game with lackluster graphics and crappy controls will catch some users if one can relate to it. Fortunately for Puzzle Farter, it hits all three.

So go play it! The only criticism I would have is that it has very little replay value, but that is dwarfed by the joy of playing a game that exemplifies the "trifecta." Plus it makes me giggle like a school girl every time I hear the fart sound.

Uh oh… Adobe’s store has become… BAD FLASH

June 9th, 2008

IMPORTANT EDIT!
As it turns out, it's actually just Adobe's store that's all crapped up, but the point remains!

"What's that," you say? "Surely Adobe.com Adobe's store could not be a bad example of Flash, for they are the stewards of Flash, and would never abuse its power." But I think they have. I'm not going to delve too deeply into this, since it's an exercise in frustration, but I believe that Adobe has fallen into the trap of replacing HTML/JavaScript with Flash where it's not necessary, and is indeed a worse choice.

I present the following three reasons as proof:

  1. Because the MouseEvent.MOUSE_WHEEL event is broken on Macs, Adobe has destroyed Mac users' ability to casually scroll through a page, instead forcing us to revert to the arrow keys or, god forbid, actually dragging the scroll bar.
  2. Many of the things I love about Firefox (my web browser of choice) are completely broken on this site. I can't open links in a new window by middle or right clicking, as Adobe decided that links must behave exactly as they would on an HTML page by opening a page.
  3. There is nothing I have found on this site that cannot be done (perhaps better) using HTML and JavaScript. The only Flash-related effects I've seen are rudimentary transitions and overlays that would be just as easier, if not easier, outside of Flash.

There's something to be said for using your own product. After all, if the cook won't eat his own food, something is amiss. But honestly, why go to such great lengths to emulate something that needn't be emulated and ultimately fail to improve upon it? There isn't even any AJAXy-type stuff (which, incidentally, works just fine as actual AJAX).

Don't get me wrong. I love Flash and ActionScript, but I love appropriate use of Flash and ActionScript even more. Inappropriate use of Flash is what makes some people hate it, and given Adobe's stature, their misuse of Flash is correspondingly huger.

Twitter visualizations by keyword

April 29th, 2008

I know I said I wanted to keep this blog technical, but it looks like that may not be the case. Maybe I can look at this from a technical point of view...

http://twistori.com/

twistori is an interesting, social experimentish Twitter visualizer that lets you choose one of 6 predefined words relating to emotion, and watch as related tweets go by. Technical: It's not Flash, which means AJAX + DHTML, which is kind of neat. It's definitely nicely done. So often these things aren't.

This is absolutely incredible

April 27th, 2008

Someone showed me a demo from a piece of software called Seam Carver, which uses a very clever algorithm for "content-aware" imagine resizing. The software searches for rivers of what it deems to be unimportant pixels. These rivers or "seams" are then removed as needed to resize the image. Check out the website/video for a more detailed explanation, and mind-blowing demo:

SeamCarving.com

Blogging is harder than I anticipated

April 25th, 2008

I keep thinking about it, I swear. I want to blog for you. All of you. I feel like I have things to say, but when it comes time to put... uhhh... keyboard to text input, I blank out. There's plenty of personal stuff I could post about; I'm a little panicky about graduating, money is a scary thing, etc. But that's not what I want this blog to be about. I want this blog to be more about my identity as a New Media... guy.

But since I have nothing else to post about, let's go personal for today. I've started running, but not in the way that I've done before, where I run for a day and then forget about it for a month. It's only been two days in a row, but I feel far more committed to it. I think it has something to do with the fact that Rochester has come out of its annual Dark Age. I think I finally realize why people like running: Endorphins.

FITC: Post Mortem

April 24th, 2008

Well, I'm back from FITC! It was pretty awesome. I'm sorry for not posting about days 1 and 3, but rest assured they were cool, and I got a lot out of it.

I went to FITC with the intention of going to a lot of cool tech demos and hearing the latest about Flash and ActionScript and all the other cool technology that I use, but as time went on, I found myself drawn more to the creative/design talks. They were much more inspiring, and I realized that I could get much the same info online that I could in the technical topics. No real substitute for inspiration though!

Flash in the Can: Day 2!

April 21st, 2008

I realize that I haven't posted in forever, but I'm at FITC, and I just paid $13 for a day's worth of internet, so I'm going to use the internet to its full advantage, god dammit.

So! I should probably make a retropost for Day 1, so look for that later. Right now, though, I just got back from seeing ISO50/Tycho and a panel on getting into the industry and some famous designer's experiences. Horrendously interesting stuff.

I also bought a few ISO50 posters! They're awesome.

Time to get back to it.

PS Remind me to talk about our little sneak peek from Adobe of Flash CS4. F-curve editor for tweens? Yes, please.

ActionScript Cross-post: Flash Media Server is CRAZY!

February 13th, 2008

This is a cross-post from my Labs site that I set up for code tidbits from school projects.

And not in a Alicia Silverstone and Liv Tyler 90's music video hot kinda way, either. The kinda way that makes you think, "What the hell were they thinking when they implemented this crap?" After that you think, "And why didn't they make good tutorials?"

Let's talk FMS + AS3. Since the tutorials are in some kind of AS1/2 moon language, I thought I should post the AS3 code I finally managed to get working, so that you all won't have to waste your time (hopefully). Here goes.

Client-Side
The client-side is pretty straight forward if you know AS3, but if you've been trying to use the guides Adobe gives you, there's a slight twist.

 
package {
  import flash.events.NetStatusEvent;
  import flash.events.SyncEvent;
 
  //This bit is important!
  import CustomNC;
 
  public class MediaServer {
    //Note the use of a custom class (CustomNC) instead of NetConnection!
    private var client_nc:CustomNC;
    private var rtmpAddress:String = "rtmp://rtmp.address/my_rtmp_app_folder";
 
    public function MediaServer() {
      //trace("New MediaServer");
      init();
    }
 
    public function init() {
      client_nc = new CustomNC();
      client_nc.connect(rtmpAddress);
      client_nc.addEventListener(NetStatusEvent.NET_STATUS,onClientStatus);
    }
 
    private function onClientStatus(e:NetStatusEvent) {
      trace(e.info.code);
      if(e.info.code == "NetConnection.Connect.Success") {
        trace("Successfully connected to RTMP server.");
      }
    }
  }
}
 

This is the class I created to deal with Flash Media Server. One key piece here is to create a custom NetConnection class (which I'll provide in a sec) to allow the server to send down function calls.

 
package {
  import flash.net.NetConnection;
 
  public class CustomNC extends NetConnection {
    public function CustomNC() {
      //trace("New Custom NetConnection");
    }
 
    public function myCustomFunction() {
      trace("Sup");
    }
  }
}
 

That's it! I know it's not much, but it's the only way I've found to allow the server to pass down orders. This bit of code is intended to replace this (because it's no longer valid syntax in AS3):

 
myNetConnection_nc.myFunction = new function() {
  //Stuff!
}
 

Server-Side

Now for the server-side stuff. Honestly, this is looking way easier than it was to figure out. Oh well.

 
application.onConnect = function(newClient) {
  application.acceptConnection(newClient);
 
  trace("Accepted connection");
 
  newClient.call("myCustomFunction");
}
 

That's pretty much it! Save that as main.asc and pop it into your RTMP folder and it should run like a charm. Theoretically. If you need to troubleshoot, don't forget to reboot your application (just the app, not the server) after overwriting your main.asc file. Otherwise, it won't use the new code!

Leave a comment if anything is unclear or you're still having problems. Or email me at chris at iamnotgoodattheinter dot net.

Oh, I almost forgot, the ActionScript syntax made possible by this cool WordPress plugin. Go nuts!

http://ideathinking.com/wiki/index.php/WordPress:CodeHighlighterPlugin