background top

Canvas to replace Flash? Not likely.

Is this the end of Flash?

Came across an interesting article that talks about a new element that was introduced in recent browser releases. The canvas tag. In this article they are suggesting that the options provided with the canvas tag are the same as those which Flash offers.

The largest hurdle canvas has in replacing flash is performance. A flash SWF file is compiled. That means it’s a binary file that only the Flash player (and compatible players) can understand. Canvas on the other hand is controlled exclusively by Javascript, a scripted runtime language. That means that the code is interpreted and run at the time the page is viewed.

Take a look at this article which starts the discussion: Is Canvas the End of Flash?

However, although canvas may not replace flash, it does have many niche uses. One problem it is looking to solve is that of font limitations. Take a look at typeface.js, a library that replaces text with fonts other than the few web safe fonts we’ve used for years.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • Reddit
  • TwitThis

8 Responses to “Canvas to replace Flash? Not likely.”

  1. Jake Says:

    Not quite. While the browser retrieves javascript code in its plaintext form, there is nothing to prevent it from compiling it before running it. In fact, most performant browsers do just that.

  2. Bob Says:

    A SWF is compiled bytecode which isn’t that much faster than interpreted JavaScript. The latest browsers have started to use similar techniques to make JavaScript about as fast anyway.

    The real reason canvas isn’t ready to replace Flash is that Flash has video and audio support built right in, a great editor for coding, drawing and animating, good fast embedded font rendering and allot of libraries and support as a result of being around for so long. Flash is also far more reliable across browsers at the moment and has a better rendering engine. All this is going to change very quickly.

  3. Jeremy Says:

    You make a good point that performance may not be such an issue in the near future. Perhaps I should have focused on the fact that we’re really comparing apples and oranges. If we’re talking about canvas replacing Flash for things such as animations, font rendering and basic vector graphics then I can see where it may take some of the market. However that is only looking at very limited capabilities of Flash.

    For Flash to be replace you must look at the entire spectrum of what it covers. Now a days we’re talking about a full, standardized application platform. Flash is not just for animations anymore but includes the whole Flex platform with Actionscript 3 at the core.

    It seems all of the proponents of canvas replacing flash don’t seem to understand the depth of the platform. If you’re talking about a simple program for doing splash page intros then I would agree, but that is missing the larger picture of the Flash/Flex/AS3 platform.

  4. Jeremy Says:

    Yes but that is just my point. When is that compile going to happen? It’s going to happen on the client side when they download the web page. Compiling the code may make it faster once that is done but there is that up front cost. With flash, the file is compiled when authored, before the client ever sees the file.

  5. SeanJA Says:

    Now a days we’re talking about a full, standardized application platform.

    @Jeremy

    It would be nice if that standardized platform actually worked on all platforms though… wouldn’t it?

  6. Max Says:

    Jeremy: It doesn’t cost much to parse Javascript, and Flash is far more guilty of clogging up a browser while loading. But it doesn’t really matter anyway as long as the loading time is imperceptible, nobody cares. Runtime speed is the real concern, and where Flash still has a clear advantage over most Javascript implementations.

    Bob: This will not change very quickly. It’s easy to not notice the major advancements Flash makes in new versions that keep it a few years ahead of everyone else, but this combined with an always slow rate of adoption among browsers (and users) keeps things this way. Now I’m not saying it won’t change, but it will not do so quickly.

    SeanJA: I currently use Linux and I can state that it does work on all platforms with far more reliability than the multitude of browsers out there. Even if Firefox is more stable on Linux than Flash, IE does not come with canvas support last time I checked.

  7. Jeremy Says:

    Max: I agree with you for sure. I maybe shouldn’t have focused on the performance based issues as technology is constantly evolving and you are right that differences are fairly minor at this point.

    You bring up a good point though about the perception which I think is what gets people upset about Flash. There are a lot of heavy download Flash sites out their that don’t mask the work they are doing. Therefore as far as perception, it always seems the Flash is the slower of the two (between Flash and Javascript).

    Maybe I should do a more “feature to feature” comparison of what Flash offers compared to Canvas/Javascript solutions. As I’m learning more about Canvas it seems to me as though this comparison is almost apples & oranges. There is definitely feature overlap but they are really different beasts which I believe can co-exists.

  8. Jeremy Says:

    SeanJA: Of the two though, Flash is bar far more standardized. Just the javascript issues you run into alone with the difference between Firefox and IE are amazing. Then of course you have different versions of each browser, as well as a number of other browsers that have enough market share to notice (Chrome, Safari, Opera). So when talking about it that way I have to say the Flash/Flex platform is far more standardized.

    I’m wondering if one of the reasons this topic gets people so riled up is that Flash is a proprietary technology? People don’t just want a standardized platform – they want a standardized OPEN platform. Of course there are positives and negatives to both – perhaps the topic for another blog…

Leave a Reply