Blog

  • Collection & Iterator and Class(cast)

    I learned how to utilize the Collection and Iterator patterns yesterday, thanks to Dan, the Java head (head of Java) at my job. I had previously asked Kenny B awhile ago, and he had explained it just as thoroughly, but typecasting to interfaces was a fuzzy subject, as was why one would do such a thing.

    Additionally, so satisfy Google keyword searchs for said topic since the ones I found were pathetic, I hope to create a new tutorial this weekend on AMFPHP and utilizing the mx.utils.Collection, mx.utils.CollectionImpl, mx.utils.Iterator, and mx.utils.IteratorImpl. Contrary to the docs, the whole dragging of an SWC file to get the classes file to work doesn’t work; I tried. You have to get the files from the AS2 Remoting Source files download, as mentioned at Rich-Internet.

    The only roadblock I’m having with them is I can’t get my authoring component to work. The code itself works beautifully, and I’m overjoyed at how neat Collections and Iterators are; you can do a crapload more than one could do using arrays and looping through them with far less code. However, following the docs to the T, I still couldn’t get my component properties inspector to show anything. If you know, let me know.

    Secondly, something I saw in Moock’s book and in the docs which baffles me is the whole:

    var value:Class = Class(something);

    Now, I know do this to avoid a type-mismatch error:

    var i:Number = 1;
    var o = String(i);
    var str:String = new String(o);
    trace(str); // 1
    trace(typeof(str)); // object
    trace(str instanceof String); // true

    The conversion of i to a string via using the String class constructor makes sense, as does Number (although, I recommend parseInt). But when the docs do like:

    var button:ButtonC = ButtonC(someObj);

    That's weird... it doesn't work. In the example they give for CompactDisk, the constructor does not do any initialization at all. Maybe it works in other languages but you cannot assume that doing the above will work like an attachMovie initialization object, and simply set the class's member variables to the value passed in; it only works for Intrinsic classes OR ones you've specifically wrote yourself. By Intrinsic, I mean:

    s = String(num);
    num = Number(s);
    d = new Date(2004);
    a = new Array("mic", "check");

    But if you make a class CompactDisc, and don't do squat with your constructor, passing in an object into CompactDisc will NOT return a valid object. My example didnt' work till I did this myself:

    function MyCollectionDataConstructor()
    {
    if(arguments[0] != null)
    {
    for(var p in arguments[0])
    {
    this[p] = arguments[0][p];
    }
    }
    }

    When I did that, she worked like a charm. My guess is, in Java or some other language, this just works:

    var val:NewClass = NewClass(o);

    Where o is some object with data, not of class NewClass, and by doing the above it returns a converted instance or something... whatever man, not in Flash. Do the above, and you get the same effect, though.

  • AOL Instant Messenger Uses Flash Video?

    I started AIM this morning, and it displayed a little video where the ads are up top. It crashed after about 3 seconds of playing (I had a big SWF compiling, and had iTunes eating mad bandwidth).

    I opened and closed the Buddy List trying to get the video to play again (since a new ad comes up when you do this). However, the closest I got was the M&M ad for m-azing.com. I tried clearing my cache in both IE and Firefox, and dug around in my registry as well as the AIM install directory trying to find out if it did a setting somewhere to register I viewed the video to no avail.

    Anyway, curious if someone can find out if it was done with Flash Video. The website doesn’t use it (Windows Media or Quicktime).

    Sorry about my comments being down; MoveableType is extremely easy to break, and considering I don’t know Perl, upon attempting an installation of a Captcha test, I broke something. Until Perl blog spam bots go extinct, I have to deal with these issues.

  • Undoing the Industrial Revolution

    Via her majesty.

    Jakob Nielsen writes about Undoing the Industrial Revolution. I thought it was a good article full of futurist thinking & rhetoric to make you believe what he’s saying things will eventually do or be.

    I disagree with his point that people will never really leave work because they are so accessible via communication technology is a positive thing. I’m sure he meant it a lot deeper since he only uses a short description to talk about it. That’s a bad thing for those who don’t have a choice. Stress is the biggest health problem in this country, and it’s only getting worse. Being accessible 24×7 does not facilitate one being able to leave work at work. My dad is a salesman, and although this ability makes him really successful and builds his reptutation as dependable, he’s always on call and at times makes him diffucult to deal with family wise.

    However, I cannot deny the positives. I fully agree with his geographically dispersed companies and services. The ability for me to work at home, and provide my talents remotely to a still physically accessible team is great. I save money, significantly reduce wear and tear on my car, gain at least 2 hours of my day back from driving, and have a lot less stress.

    It’s nice, too, to hear about the need for colaboration technologies. In my own experience and talking to others, the biggest challenge to getting outsourcing to really work is communication barriers via distance. Time is one thing, but software to help offset that is another. I’m sure as technologies such as Breeze, LiveMeeting, and Convoq’s ASAP mature, we’ll see this improve, but I’m not sure if it will catch up to the point where we need it now, for someone like me at home use and for companies who are outsourcing abroad… or by the time it does, it’ll start an exodus, kind of like how I only work 2 hours away, but then increasing numbers could do that, and eventually remote locations are far more accessible; as soon as such technology successful satisfies our needs, and we in turn adapt to some their new paradigms, if any.

    Good article.

  • Halo 2, Half-Life 2, and Gaming Engines

    Finished Halo 2 last week in a week of nightly playing. Although I did dig the game (I don’t have XBox Live), I wasn’t really impressed. The hype to me certainly wasn’t justitified, and I feel bad Bungie did “a lot of work” for that. I thought the character development was cool, the cut scenes were great, and the story only had a minor hole about Convenent’s being at war too much to really understand the Forerunner technology they are actually using. The ending didn’t bother me at all like it did others, but it was certainly a short game.

    I attempted to play Half-Life 2 on Friday night since Brandy bought it, and although her comp could only run it in low mode pretty good, the loading times drove me nuts. So, I purchased, downloaded it all Friday night, and then started playing Saturday night. I finished it Sunday evening. It was a really great game, with great graphics, story, acting, and characters you really liked. You really felt like you were part of the story. The vehicles were a really nice change, although, the drive controls poorly compared to the ones in the Dessert Combat mod for Battlefield 1942. Either that, or the dune buggy has the lamest tire traction in the world. Considering I ran the game for about 4 hours straight Saturday, I was impressed with no memory leaks that I could detect, although they are well hidden on this machine. The large amount of sounds in the later levels did a number on me Sunday, though. Blue screened at least 5 times, but I have a pencil handy for a forced reboot, and she boots fast. I’m really thinking my sound card is tweaked weird cause it did it 3 times with Call of Duty.

    My Alienware officially does not suck as I ran every setting as high as it would go including Antialiasing x6, and the Anistropic filtering x16, and 5.1 surround sound, high quality. Money well spent on an entertainment center. Only 2 places in the game where my framerate freaked out for a few seconds, but the game was still playable.

    Still, beating it in 2 days is kind of harsh. What really blew me away, though, was there is no multiplayer. I hear it’s coming, but wtf dude. It’s just a given Half-Life related games are multiplayer by nature. How long did they work on Half-Life again?

    Secondly, Steam is still not very impressive considering how long it’s been around. When purchasing a game, you really don’t know what your purchasing, and I’ve yet to find a way to “return merchandise”, not that I’ll be mad if I can’t, but I really have no need for the extra games I bought, which I thought Source meant the source files, not an updated engine version. It was clearly mentioned in the marketing that Source is the name of the engine, but I just assumed it was a marketing push for mod development. Too much too late.

    I’m looking forward to seeing what Source offers since a lot of the mod community behind Half-Life is really strong and diverse.

    As far as engines go, I still think Doom 3 has THE BEST quality I’ve seen so far, but the actual distance drawn is wayyyy small in comparison. Far Cry has THE BEST environment and distance engine I’ve seen, and the physics are good, but I don’t think the game took advantage of them like Half-Life 2 did. Half-Life 2, so far appears to be the most well-rounded, and easily customizable, but Far Cry has the coolest editor I’ve seen. It’s nice to know there are so many options nowadays.

    This weekend I’m eager to sink my teeth into Metroid Prime 2: Echoes.