Saturday, November 8, 2008

Re-dispatching an Event in Flex

There's a trick to re-dispatching a custom event in Flex, and I always forget what it is. Hopefully, I'll remember to look at my own blog the next time I get stuck.

Here are the symptoms this solves: You're dispatching a custom event in one component, then catching that event in another component, only to dispatch it again. But the event never gets to the next component up, which is listening for it.

The reason it's not working is because the flex.events.Event.clone() method is being called when you call dispatchEvent() the second time. All you need to do is override it that function in your custom Event class:


public override function clone():Event{
return new MyEvent(type, mytype1, mytype2, bubbles, cancelable);
}


This fixes the problem every time, and the re-dispatched event will get to the next component. Of course, if you're doing more than two layers of dispatching to get what you want, you may want to consider a better design, but this is useful as a quick hack.

Monday, October 20, 2008

Don't be a Robot!

I am sick of American politics. Watching the past few debates has reminded me more of two preprogrammed robots than anything. Rather than seeing how their ideas bounce off of each other, they just keep saying the same things over and over again.

We already know how you stand on economic policies! We know what you think about foreign policy! What we want to know is why you think that way. We want to see that you've thought out your stance, not just that you have one! We already know that!

Conversely, here's what my ideal candidate would say:
I acknowledge both that there are benefits to both raising taxes on the upper class, and lowering taxes for everyone. There needs to be a balance between helping the poor and helping the economy. That balance is (insert a thought-out economic policy here). The balance lies there because (insert reasoning why the line is there)

The point here is that Democrats and Republicans both have good ideas, and I have never heard a candidate attempt to take the best of both! (And of course, those two parties don't have a monopoly on good ideas) Robots can be programmed to defend any policy. A human will think about those policies, apply reason, and come up with something better!

Thursday, October 16, 2008

Flex Builder in Linux!

I was excited to learn today that Adobe is working on a version of the Flex Builder Eclipse plugin for Linux. It's available now in alpha. It doesn't do some of the design layout stuff yet, but it does do code completion and syntax highlighting. (Besides, only people who hate source code use the design layout tool!)

One word of caution: the plugin currently only works with Eclipse 3.3.x! Ubuntu gave me Eclipse 3.2.2, which didn't work with it, so I tried the latest release, 3.4.1. That one doesn't work either! You need 3.3.x.

Anyway, here's the download page. You get much longer than the standard 60-day evaluation period. Enjoy!

Saturday, July 26, 2008

Democrats are Cool

After a lifetime of compulsive TV watching, I've learned some interesting things about politics.

Democrats are cool. Their policies are socially acceptable. They represent the downtrodden, work-class people.

Republicans are socially backward. The only reason they're not as smart as Democrats is because either:
  1. They're Southern, and don't know how to read, or
  2. They can read, but the only things they read are Christian.
Whether an individual Republican is to be mocked or pitied depends on their belligerence. Ann Coulter, for example, is extremely outspoken, and should be mocked as harshly as possible. Poor, religious people are to be pitied until they start talking about Christianity, at which point they become belligerent.

I'm not making an argument for either side here. I'm simply stating the message of the Viacom Propaganda Machine.

Saturday, June 28, 2008

Long Time Coming

OK, so I've been lazy. This is my first post in 5 months. I was going to school, but I don't really have an excuse for the last 2 months of summer vacation.

Anyway, here's some funny stuff I found in the last 5 months:

Funny Adwords - Some actual Adwords that people have seen. Pretty funny.

Demetri Martin - Findings



And here are some more Demetri Martin videos. He's funny.


Mandelbrot Set video



Ha. Clever.

I don't know if I actually have an audience, but if so - look for more posts soon!

Thursday, January 10, 2008

My Top 5 Firefox Add-ons

One of the great things about Firefox is all the cool add-ons available. If there's anything you don't like about Firefox, there is an add-on to change it. And I have the same add-ons for my Linux machine as I do for my Windows machine, so it's pretty good that way too. It's always a pain to have to switch between different tools that do the same things.

So, without further ado, here are my favorite Firefox add-ons:

  1. PDF Download
    This one allows more flexibility about what FF does with PDFs. Instead of just opening it in-browser, it allow you to download it, open it in a new window, or view it as HTML.
  2. IE View Lite
    Firefox is great, but not all sites were programmed with the idea that anyone will access them without IE. On Windows systems, this allows you to quickly view the current page in IE.
  3. Resizeable Textarea
    This gives you the Safari-like functionality of being able to resize large text fields.
  4. Server Spy
    Lets you know in a little section at the bottom of the FF window what kind of server a site is using. It's interesting information. Always fun to see the broken sites running IIS and say, "Oh, well there's your problem!"
  5. Web Developer
    By far my favorite FF add-on. This gives you a little toolbar with more web development tools than you would ever need. It gives css and javascript tools, shows you divs, classes and ids, style information for a given element, and lots more.
So enjoy these, and make the move to FF if you haven't already!