March 19th, 2007

The public alpha is out. I awoke suddenly in the middle of the night for no apparent reason, only to find that Apollo had been released… almost as if it was calling to me. 😉

It was fairly easy to port my current project to an Apollo app and I was pleased to discover that you can create Apollo “air” files (installers) on Linux. Not that this matters since “air” files are just zip files, so I could probably make an “air” creator myself. The Apollo runtime and debugger aren’t available for Linux, which is understandable, although they should probably find the time to port it later if they want Apollo to be taken seriously. It doesn’t matter much to me since my project works under multiple circumstances (Apollo, Flex, Flex-less Actionscript) and I do my debugging under an simpler environment.

So far I like Apollo, but it’s easy for a Flash developer to like Apollo, what about everybody else? With all the (somewhat undeserved) attention towards Web 2.0 sites, I wonder if anyone will even notice Apollo. It’s still a nifty idea anyway, and there might be a niche out there just waiting for Apollo to come along.

I'm Blocked in China?

March 6th, 2007

You read right. According to the Great Firewall of China I am blocked from Chinese eyes. Apparently this isn’t absolute, and you can be partially blocked, but I’m having a hard time understanding why I’d be blocked at all. A quick check of my neglected Google Analytics account didn’t reject the idea. I get massive amounts of Asian visitors, but the amount of Chinese visitors is low these days. Are there just less people in China interested in my site or are they not allowed? The idea that someone in China could see me as a bad influence is very strange but at the same time, pretty cool.

Update: Maybe not, Carol (who commented on this post) sees my site just fine from within Chinese borders. Oh well, my days of unknowingly subverting China are over.

I read an article today about a guy who doesn’t, like most developers, actually understand Flex’s purpose. Javascript + XHTML + CSS can’t do everything. I spent years of my life trying to make Javascript into something it wasn’t, it was only later I discovered Flash was what I was really after. I still see a place for Javascript, but it’s not in say, a 3D engine, and while someone could probably make 3D engine in Javascript, it would be inferior to one made in Flash. There’s no war between Flash and Javascript, there’s no need to pick sides, they’re just two different languages for generally different purposes. They’re opposites that together form a whole, I just heavily favor Flash because it suits my needs.

Flash isn’t really supposed to replace the back button, or make your website hidden to search engines. There’s a huge Flash blogger scene, but I can’t recall the last blog I’ve seen that was made in Flash. Javascript is in the end, an extension of HTML and it can’t escape the fact that HTML was always meant to display formatted text. It’s what Javascript + XHTML + CSS is good at and what Flash isn’t. Flash has HTML formatting capabilities, but they’re only a bonus, an extra feature, not a replacement for HTML.

There’s also the complaint that Flash is proprietary. While I agree that this is a flaw, Flash would not exist today if it wasn’t closed-source. Although Javascript is the most common platform available on computers, Flash is still second best and far more reliable. You can still flawlessly view Flash content made when Flash was little more than a vector-art plugin. People may trust it less because the player is closed-source but it’s far more constant and reliable than Javascript has ever been. Flash’s ubiquity will keep it going for years to come, so there’s no need to worry that it will be corrupted. The outrage would be deafening. One of the main reasons Flash is so popular and yet so closed-source is because it’s been handled so well over the years there’s little interest in alternatives.

Unoriginal Content

February 15th, 2007

I’ve seen two particularly strange examples of plagiarism recently. Actionscript Hero’s blog is being reproduced on several domains. I figured they were simply caching his site, but they’re actually listing his site’s IP address under their domain names. The only purpose I can see is to enhance the domain through quality content (which aSH provides) and then swap it out later with a spam site. This cannot stand.

I offer this advice to aSH and anybody else suffering from similar predicaments. There’s always ye olde .htaccess.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www.)?somedomain.com$ [NC]
RewriteCond %{HTTP_HOST} !^(|localhost)$ [NC]
RewriteRule ^(.*)$ http://www.somedomain.com/$1 [R=Permanent]

I can’t personally test this (still on a shared host believe it or not) but unless I’m wrong this will redirect any request that is not from either somedomain.com or www.somedomain.com to www.somedomain.com. There’s also an extra condition for the standard localhost and loopback addresses. You might want to add another condition for people who access your site directly from the IP address as well. This is what it will do…

http://www.plagiarist.com/blog/really-cool-post -> http://www.creator.com/blog/really-cool-post
http://www.shadycharacter.com/about-me -> http://www.coolperson.com/about-me

You could also make the page redirect to a special page which explains what’s going on to any confused readers, further depriving the content-stealing site of any credibility.

There’s another more old-fashioned form of plagiarism inflicted upon Aral Balkan. Some of his better posts were directly copied from his blog onto someone else’s blog. The offender was stupid enough to (it looks like he wasn’t aware of what he was doing, everybody makes mistakes) hotlink the images from Aral’s site so Aral replaced them with images of the plagiarist proclaiming his lack of original thought. I applaud Aral for the restraint shown and not replacing the images with something less… polite.

Simple referer-blocking will prevent most attempts at hotlinking, although I am personally aware that this isn’t foolproof. There are ways around it, although I’m not sure what they are, I’ve experienced extreme forms of this mysterious event. If anyone links to his blog, please make absolutely sure the rel=”nofollow” attribute is included so his page rank won’t be improved.

I have one last tip. If there’s a situation where a site is being cached on another site, find a way to include the IP address the person accessing your site on every page. When the content stealer updates the cache, his IP address will be included in the HTML on his site. Block that IP permanently with this .htaccess code…

order deny,allow
deny from <IP address>

Javascript is Very Fast?

January 10th, 2007

Apparently my previous post was premature. My world has shattered and I have discovered the single most impressive example of Javascript. Ever. Considering that just this morning the very same event took place (but with Flash) this is one hell of a day.

It’s an emulator. In Javascript. Take a deep breath and let that sink in.

I really wish this guy would switch to Flash. I programmed in Javascript in the old days and it’s really no good for certain things. What those “things” are is vauge, but basically, writing emulators is one of those things. In any case, Flash got there first and FC64 is cooler.

Beware of Flash Hacking

January 3rd, 2007

I spotted this post (via Digg) this morning. It’s a guide to hacking high-score boards in Flash games and he knows what he’s talking about. He uses Flasm to disassemble and find information in a SWF file. All the more reason to make sure the methods you use for this kind of thing are carefully hidden.

I heard a great idea from someone named Dan on Flashcoders. Send fake variables alongside real ones when a score is submitted. It could get even better if you make them interrelated and sensitive to hacking – something involving bitwise math perhaps? You could also include checksums of course. There was also my idea to “record” user input (mouse movements, key presses, etc), encode it, and send that to a server. Then simply add in the ability to playback these recordings when you want to make sure they’re legit. It’s pretty tricky though, and could have lots of problems, for starters you wouldn’t be able to change your code without breaking old recordings and you can’t use Math.random().

While I don’t like this guy, it’s not as if these methods aren’t known already. Why did people have to digg it though? It’s cheating. What’s the point? I suppose Flash coders just have to get smarter when it comes to this kind of thing.

Bad Wii Design

December 30th, 2006

Update: I wasn’t really able to test this until now, but it looks like both media=”tv” and media=”handheld” (for when you press the “2” button) aren’t implemented. Like most beta software, there’s flaws. Hopefully this will be implemented in the future.

I’ve seen some WordPress plugins lately that change how WordPress looks if the user is accessing it with a Nintendo DS or the Wii’s Internet Channel.

Stop it. Stop it right now.

While I can’t really speak for the DS browser, if you wanted your site to be easily viewable on the Wii then use the features that are out there specifically for that purpose. CSS stylesheets can be loaded based on what’s displaying the website, and wouldn’t you know it? There’s a type specifically for televisions. It’s crazy enough to work.

<link rel="stylesheet" type="text/css" href="/css/special-tv-stylesheet.css" media="tv" />

Besides the fact that it’s the easier way, it also doesn’t use user agents improperly. By changing the site when the user agent has a “Wii” in it you’re assuming that people actually want it to be changed. I sure don’t. The Internet was never meant to be customized for Wii users, it’s already prepared for that. It’s not even a real way to detect Wii users either, it’s just a hack. I already went over this a few weeks ago, but relying on user agents is almost always poor web design. You’re also completely forgetting other lower-resolution devices that could use the attention as well.

The Internet Channel (the Opera browser) on the Wii came out today. It’s a beta (sorry, “trial” version) but doesn’t seem too bad so far. I visited my website first and was pleased to see my games worked, although I couldn’t control them (no keyboard, remember?).

Anyway, the title kinda gives it away, but the browser supports Flash 7 and no higher. I ran it through a Javascript version detector myself. What a shame.


December 19th, 2006

Check out Fauxto (via del.icio.us), it’s one of those drawing tools all Flash programmers are doomed to create at some point. Only this one uses Flex2 and does a way better job of it. People keep talking about Internet replacements for desktop software but AJAX will never really fill that hole. When’s Flash going to catch on as a webdesigner fad, anyway? Flash is so much more powerful these days it could do it all.

User Agents and You

December 18th, 2006

I tried to visit a website today that blocked me for using a browser it hadn’t heard of. Why do web designers who are aware enough to know how to access a browser’s user agent only seem to use it to block working browsers from their site? Even Google does it! Let’s set the record straight just in case somebody needs it.

  • GOOD: Noticing a certain older browser doesn’t work with your modern website, so you redirect those who use it so they can upgrade.
  • BAD: Thinking that all browsers except for the few you’re aware of are probably incompatible, so it’s better to block them until they switch to something you are aware of. It could be a security problem if they access your site with an incompatible browser so detecting the user agent is a perfect way to prevent this.
  • GOOD: Relying mostly on CSS and XHTML to ensure that your website will be easy to view in all kinds of browsers (text browsers, older cell-phone browsers for example).
  • BAD: Since your site is table-heavy you change the content based on the user agent (or even possibly the language) to ensure that it can be viewed everywhere. Unless your site is frequently updated it will eventually become outdated and improperly handle newer browsers.
  • GOOD: A specific browser has a bug, so you redirect it when it’s that specific version. That or alter your site so it continues to work while keeping it compatible with other browsers.
  • BAD: A specific browser has a bug, so you block that browser entirely. That or you block all versions starting with above the one with the bug since it will always have that bug.
  • GOOD: Assuming that the user agent can be faked, you develop future-proof ways to detect browser features.
  • BAD: Since browsers are required by law to deliver proper user agents, you use them to detect what features are available.

Basically, don’t change your content based on what browser is accessing it unless that specific version has a problem. Assume future versions will not. Don’t use the user agent in Javascript to detect what features are available. The key word is future-proof, just deliver standardized content and hope for the best. If you really want to do any of the bad things on that list, then at least allow people to bypass it somehow.