Thursday, February 28, 2008

actionscript 3 class definition and importing sickness

Sorry, but this post is about some programming garbage.

Okay, so i decided to write a little ActionScript 3 code since it's all object-oriented and somehow "real" compared to the previous joke versions. I was trying to create a small class that did some simple stuff and get it working in the Flash environment. After reading several examples straight from Adobe and some forums I wrote what looked like a simple, pristine piece of code that should have worked.

The error I got when I tried running the code was this:

1180: Call to a possibly undefined method xxxx


This basically means that Flash couldn't find the class that I created. But I didn't get any errors from the "import" statement that references the .AS file that has the class in it (inside a package{}).

If I changed the filename I'm trying to import I get an error. Ok, so it knows the file is there but it cannot find the class inside the file for some reason.

I searched all over the net for an hour trying to find the answer to this problem. NOWHERE DID I FIND THE SOLUTION THAT I AM ABOUT TO GIVE YOU. The solution to the problem is something that, evidently, Flash programmers JUST KNOW from experience but the solution isn't written anywhere that I could find on the internet and my Flash coders don't know how they know the technicality I'm about to explain.

So it comes down to this: the way you write the name of your class MUST be the EXACT way you name the .AS file it's in.

For example: if I create a class named BugJar like so:

package
{
  public class BugJar
  {
    //...code...
  }
}


then I **MUST** save it in a file named BugJar.as!!!!

Inside my framecode I would have:

import BugJar;


...and it would work.

This is just completely disgusting to me as a programmer. Linking the name of a class to the filename of the file it's in is just wrong.

What's worse is that Flash doesn't even give you the proper error for this:

filename: bugjar.as


package
{
  public class BugJar
  {
    //...code...
  }
}


framecode:

import bugjar;
var jar:BugJar = new BugJar();


The above example WILL NOT WORK and Flash doesn't give you an error message that helps you understand or fix this problem that shouldn't exist in the first place.

Monday, February 25, 2008

blue oyster cult loves star blazer?

So I was watching some of my favorite Blue Oyster Cult vids on YouTube and when I started up "Take Me Away" I was amazed to see someone playing Tony Suzuki's Star Blazer on a green-screen Apple ][! WTF??? CRAZY.

I never saw this vid on MTV back in the day so this was new to me. If you want to check out more BOC vids check out "I Love The Night".

Sunday, February 10, 2008

you got mcroll'd!


This video is so jacked up and disturbing it made me cry I was laughing so hard!

Thursday, February 07, 2008

mew

A recent favorite group that I discovered (through my wife) is Mew, a very complex pop Danish band. Check out their website and you'll immediately notice by the insane navbar at the top, and the audio, that this group is really different.

Their 3rd album, Frengers (2003), was their first big hit album (check out the songs: 156, Am I Wry and Snow Brigade on YouTube) and their latest, "Mew. and the Glass-Handed Kites" is amazing. Check out the video of their single from this album, Special.