Ajax from a Flash Developer's View

I started reading Head First Ajax.

If you liked the Head First Patterns book, this is the same format. Easy to understand. Gets you a good, quick understanding of the topic. It’s definitely taken the mystery out of Ajax for me.

Asynchronous. No problem. You’re a Flash developer. Ever load a movie clip? A jpg? XML? You create an object, set an onLoad handler, pass it a URL to load. When the content is in, the handler fires and does something with the content. Apparently this is a revolutionary concept in the HTML/JavaScript world.

JavaScript. Think AS1. Add the DOM, which is just a tree of elements. Think nested movie clips with some methods to find things. Or better yet, if you know AS3, think Display List. In another sense, it’s similar to working with an XML document, creating and appending nodes, setting attributes.
XML. Yeah. XML. Cool.

For me, the biggest thing is realizing how powerful DOM scripting is. I’ve done pretty little with HTML overall. I was surprised you can do so much with it. From there it’s just setting up the request object, setting up a service to return some data, calling it from JavaScript and manipulating the DOM with the result.

Of course, there are various libraries and frameworks that build in all kinds of even more powerful features.

I doubt I’ll be building any huge AJAX apps in the near future, but I do have an idea for a small project or two. Anyway, it’s nice to get at least a basic understanding of the subject, so when I hear people talking about it, I’m not totally in the dark. Another reason it’s good to know is that AJAX is often positioned as a competitor to Flash. It’s hard to answer that when you don’t really know what it is. If anything, now I see how I could use the two together to make some pretty cool things. Stay tuned…

This entry was posted in General. Bookmark the permalink.

7 Responses to Ajax from a Flash Developer's View

  1. Mark Lapasa says:

    Thx for the AJAX resource recommendation. I’m not sure if I will read it immediately soon but I am a huge fan of Head First Design Patterns book.

  2. I’m fairly convinced AJAX resurfaced as a necessary platform to appease corporate america. Because of the many thousands of java/.net developers who don’t understand Flash/timelines, interactivity, engagement and have been under great pressure to give their apps. some “flash like” behavior; AJAX blossomed. I work at large site and we’re finding that AJAX is messing with unrelated DHTML and CSS if they live in the same page. I think sometimes it’s messing with my Flash aps and/or slowing them down too. Sometimes AJAX it’s done well, but it’s almost always very slow and the engagement/interactive factor isn’t in Flash/Flex’s league. How bout the new yahoo homepage AJAX? This annoys the bejesus out of me mostly becuase there’s very unessary animation just for the sake of “hey, look – we can animate this tabbed box w/ javascript…aren’t we on the cutting edge” 😉
    Just my two cents.
    –Michael Kaufman

  3. kp says:

    Well, I guess Ajax will have to go through its “here’s a horrible Ajax site, this proves Ajax sucks” phase, just like Flash did. (actually I think Flash is still going through that, amazingly.)

    I look to a site like http://www.netvibes.com, which I’ve been using for months, as a great example.

  4. I’ve used AJAX for a couple of admin features but it’s just too hard to get excited about javascript being able to do (cross platform/cross browser) some of the things Flash has done for years. I’ll be more impressed when an AJAX app is available for me to use offline.

  5. Troy Gilbert says:

    Looking for a great offline AJAX app? Check out TiddlyWiki. It’s a whole Wiki app that runs from a single HTML page (which includes the wiki “database”) and requires zero server-side. Lots of ideas there that still aren’t very widely implemented.

  6. Faser says:

    Local Ajax? It is here. Just use Firefox as a browser and you can load an Ajax application from remote, as a standalone app or as a firefox extensions.
    Some examples:
    http://www.ajaxlaunch.com/ajaxwrite/
    http://faser.net/mab/
    http://developer.mozilla.org/en/docs/XULRunner

  7. Chuck says:

    This person wants to teach AJAX most effectivley, so they are doing it with Flash presentations.
    http://www.javapassion.com/ajaxcodecamp/

    In other news, HUMMER dealers are lending Toyota Pruis(s) to their customers when they come in for an oil change.

Leave a Reply