Silvelight Resources Directory Update (28 Aug) Silverlight 3 vs Flash: Digital Clock Demonstration
Sep 08

Today, I would like to show you a Flash vs Silverlight comparison on the Sliding Image Gallery!

The effect is a simple and dynamic Sliding Gallery.

It is very easy to customize. We can add as many images and descriptions we like .

And the effect is very good for fast photo gallery, scrolling banner, website and so on.

Let’s enjoy it and leave comments!!

Comparison

Flash implementation: 40 minutes

Silverlight implementation: 30 minutes (Implemented First)

Source codes

Flash

Silverlight

Shares and Enjoy~

Did you like this post?

Subscribe here:  

63 Responses to “Silverlight 3 vs Flash 10: Sliding Image Gallery”

  1. DDowell Says:

    Why is there such a speed difference between the Flash and Silverlight versions? Also, strange artifacts can be seen in the Silverlight version. Is the plugin so bad at rendering?

  2. Kos Says:

    The artifacts are present in the flash version if you pay close attention. It’s just a little harder to see because of the speed so the question is why the speed difference?

  3. Michael Hoskins Says:

    Silverlight is faster at rendering to the screen. No surprise there, since most of the heavy lifting is being done by the .Net framework (hardware bitmap drawing). This would be a bit more compelling if the tweening algorithms had been the same for both.

    If you need raw easing equations, there are many out there, and I have several that could be used in both environments.

  4. caz Says:

    I think Kos means that the flash is way faster. certainly true on my screen.

    As said, it’d be nice to see 2 applications moving things at the same speed and a report of the frame rates for comparison.

    This demo looks like it’s been made to purposefully inhibit comparison.

  5. Les Stroud Says:

    I bet this would be faster to implement in javafx.

  6. Ai_boy Says:

    About speed… DO NOT FOGET….

    1) Flash animation just render frames. Flash have no classical “timeline”. So if there 20 frames that could be rendered for 1 sec if would render it for 1 sec even if you what 2 sec… (there is a way to avoid this but this is default)

    2) Silverlight concept is different. Silverlight animation is hardly binded to timeline… So, if there is 20 frames that can be rendered for 1 sec, Silverlight will render them for 2 sec (ofcource if you say that you whant it done for 2 sec)…

    So this is the “speed” diffrenses.. Plz. calculete speen using FPS, and NOT you fillings.. :)))

  7. Dalibor Says:

    I did not understand that last comment.
    I also fail to see the intent of the comparison.
    Flash is faster? Silverlight does slides prettier/smoother?

  8. Jack Bond Says:

    I agree that the speed differences make a comparision difficult. The one thing that was very easy to determine though is that Les Stroud is a moron.

  9. Ernestas Says:

    OK… I will explain post 7…

    Flash uses frame animation:
    so you have 20 frames, animation takes 1 second, everything is nice…
    BUT if your computer will lag a little, animation will take 2 seconds, because EVERY frame will be drawn…

    Silverlight uses timeline animation:
    so you have storyboard with 3 render transform changes, animation takes 1 second, everything is nice…
    AND if you computer will lag a little, animation will take 1 second, because it uses helper functions to simulate bounce (this sample), or something else.

    That’s WHY silverlight app is MUCH smoother than flash!

  10. Dalibor Says:

    This does not explain why the flash animation is so much faster (except if the author meant it to be like that). Flash does have the target FPS that it is trying to achieve and for a such a simple animation there should not be any lag.

    Why am I even bothering to write this …

  11. pixie Says:

    I think what he is saying is the flash animation renders faster/slower based on the speed of your computer, while the silverlight animation renders based on a pre-determined time line. So that if your computer is faster the silverlight version will just render more frames instead of speeding the entire animation up.

  12. pixie Says:

    Sorry after comparing these two again the flash animation bounces, while the silverlight animation has no bounce. Both seem to run in 1s. Can you remove bounce from the flash version for a more even comparison?

  13. Michael Hoskins Says:

    Ernestas - You can use time-based animation in Flash, but your framerate will determine how many frames are drawn to the screen. Downloading this sample, I can see it’s set to run at 24 fps. After I increased it to 60 fps, the animation was much smoother, even with the sharper bounce. I imagine Silverlight draws to the screen as fast as it can no matter what, being a time-based tool.

    I also looked up Microsoft’s easing equation for BackEase, but had trouble adapting it to Actionscript (spent way too much time on it :).

    This is a flawed comparison, because the tests aren’t equal, and I’m not sure what the author is actually trying to prove.

  14. Ferry Meidianto Says:

    Hum… I don’t get the idea of the comparison… not exactly the same animations…

  15. Ernestas Says:

    Silverlight has bounce. Just find timeline and click on a keyframe… On the right in Blend window you should see Easing functions. One of them is bounce…

    Plus…

    Hmm… Silverlight still could to it faster (i mean “visualy faster”)…

    Equals…

    Just **** (very censored…):
    http://silverlight.services.live.com/invoke/99396/SilverGoogle/iframe.html

  16. Re: For Ernestas from Ernestas Says:

    Only web and image search available, in addition, buttons on the top works too.
    (It is s*** but still it is only 17 year old work…)

  17. John C. Bland II Says:

    Such a poor example. :-/ I’m not defending Flash with this comment…just clarifying it as a bad example.

    There isn’t a need to sound extra smart, etc about why the Flash example runs faster. You’re forcing an elastic tween into 1 second. If the Silverlight example used the same tween type it would be faster as well. Notice the Flash tween bounces back and forth 3 or 4 times. Silverlight goes beyond the point then back to to the point. Huge difference.

    Change from Elastic to another tween and it will look similar.

    Just a lil’ clarity.

  18. Mario Klingemann Says:

    I don’t understand why I how a 1 second tween can be anything but “fast”. If you want it to look fast, add some motion blur. What I would find much more interesting is to see the differences in code to produce the same result or the amount of time it took you to build each example.

  19. admin Says:

    Hi all, sorry for the confuse I have made in this sample. I could explain the details.
    However, first of all, my intention of this post (as well as my blog) is to provide good materials for developers to learn more about both technology. That’s why I always provide source code.

    The differences of the animations is caused by this:
    1. The frame rate of Flash is 24. (I used to use 24 for years and it’s a habit for me to set to 24 to save CPU time). However, the frame rate of Silverlight is 60 by default. It’s my mistake I didn’t set the frame rate to the same. But I think it’s a good chance to let you guys know more about frame rate different.

    2. The easing method of the tween/Storyboard is different in Flash/Silverlight. Frankly speaking, I attempted to find the same easing method in Flash. But the documentation in Flash 9 is not easy to read, I just pick one of the easing method and complete the task.

    The ease method in Flash is Elastic.
    The ease method in Silverlight is BackEase.

  20. John C. Bland II Says:

    Exactly.

  21. ashraful.asif Says:

    nice job but great mistake :). Thanks hope it will help a lot

  22. Mario Klingemann Says:

    Flash has a “Back” easing method as well: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/transitions/easing/Back.html

  23. DDowell Says:

    Just wanted to point out to Ernastas (comment #9): Flash doesn’t render EVERY frame at all but actually skips rendering a frame if there is not time to do so. However, if you have code on the timeline this frame script will be run EVERY frame but the graphics may not be rendered in the end. You can still choke flash though if you have a lot of script running every frame (this can make tweens run a fraction longer than expected but not much longer).

  24. Tim Acheson Says:

    The Flash app doesn’t work for me, it’s broken. Perhaps its a Flash player version issue at my end.

    The Silverlight app works nicely, very smooth, very crisp, very fast — nice demo. This is SIlverlight 2. Silverlight 3 is even better. I hope this page can be updated to use SL3.

  25. Flash Clocks Says:

    Not to distribute guilt nor offend the author nor anyone for this matter but, nobody can make a comparison between flash technology and silverlight technology, they are both extremely different technologies and work with a different framework and programming language, that only proves why you or i can not compare this two technologies.

    Yes, they both have something that anyone can see that it looks like they are alike, but they are not, so…lets now get to some specific “veritas” TO PROVE MY “CASE”!.

    The thing about Frames Per Second (FPS) is not really a factor to determine that they are very different and that they ca not be compared, but it is part of the main factor, flash works with FPS, silverlight does not it seems, unless i am really wrong about that.

    The FPS subject on flash technology is all about the frame rate, how many frames it will show per second, obviously if a computer is slow, it will not show the 25 or 30 frames per second or whatever but, the thing is that silverlight does not work with FPS, it works differently, so we can not compare if the animation above is smoother or faster.

    Just for you now, the speed of the animation can be set in flash as well as in silverlight, and this seems like a very complex example for a comparison between flash and silverlight, even knowing that they are both very different technologies.

    Try to create an example of simple animation, perhaps a frame by frame animation in flash and a frame by frame animation in silverlight, it that is possible of course.

  26. Jack Bond Says:

    “Not to distribute guilt nor offend the author nor anyone for this matter but, nobody can make a comparison between flash technology and silverlight technology”

    I agree with that, any comparison would be foolhardy. Flash is an endless series of hacks in an attempt to turn something that was meant to do nifty animations into a RIA platform. Silverlight on the other hand was designed from the ground up to be a RIA platform.

  27. John C. Bland II Says:

    @Jack Bond
    Haha…now that is a hilarious statement. Flash hasn’t been purely an animation tool since Flash 6. We’re on 10 now. :-)

    @Jack Bond/@Flash Clocks
    There are definitely ways to compare the two but you have to understand there is a clear differences in the ways they are implemented (ie - frames). Both are for RIAs so Flash, Silverlight, JavaFX, etc will always get compared and that’s ok because ultimately that’s what we do when we choose a stack to invest in.

  28. John C. Bland II Says:

    @Jack Bond
    Sorry…correction. Flash 4 was pure animation, 5 was web sites/banner ads, and 6 was the introduction of RIAs to the industry. I just wanted to make that distinction since after a re-read it wasn’t exactly accurate.

  29. Jack Bond Says:

    @John Bland

    “Flash hasn’t been purely an animation tool since Flash 6.”

    I didn’t say that it was, I said that it was an endless series of hacks attempting to turn one thing into another. For example, does Flash 10 support native threads? No? So, Flash 10 isn’t getting proper threading support, it’s getting yet another hack. Hacks upon hacks upon hacks. Honestly, if Flash can’t even get threading right, you might as well just torpedo the platform. Silverlight 4 is probably going to have the .NET Framework 4’s parallel extensions which will just make Flash look even more ridiculous.

  30. John C. Bland II Says:

    @Jack Bond
    I’m not going to get into a back and forth but: “Flash is an endless series of hacks in an attempt to turn something that was meant to do nifty animations into a RIA platform.” Huh? Okie dokie…not saying it is an animation tool trying to be a RIA platform? :-)

    Threading is needed, I won’t deny, but without threading we should trash the platform? Really? Quite a narrow view there dude.

    Silverlight has C# which is miles ahead of AS3 and has nothing to do with Silverlight. C# simply rocks the socks off numerous languages (on the client and server) but Silverlight does not rock the socks off Flash hands down, or vice versa for that matter. Both blow each other out in multiple ways.

    So paraellel extensions potentially makes your code better but bottom line is the end result, right?. If a Silverlight app works just as well as a Flash app, sweet. Vice versa? Sweet. Does it matter if you used threading, parallel extensions, design patterns or anything else under the hood? Nope.

    Fanboyism won’t win you any special seat at MIX this year. ;-) lol

    (not responding to anymore because I’m not interested in a platform battle as it is fruitless)

  31. Jack Bond Says:

    “but without threading we should trash the platform”

    Kinda hard to make real apps without decent threading support.

    “If a Silverlight app works just as well as a Flash app, sweet. Vice versa?”

    Um, just how exactly is a Flash app going to work just as well as a Silverlight app when it’s stuck on a single thread on a single core? I’m not talking some sort of abstract trifle here. As future CPU development is stressing parallelism, this is only going to get worse.

    You say C# is miles ahead of AS3, which it obviously is. If I’m a developer and I can write apps 10 times more quickly in Silverlight because of the language and the unbelievable quantity of 3rd party libraries, why am I going to waste my time with Flash? It’s really comical how you divorce ease of development from quality of app. I suppose if the development language for Flash was assembly that would have no impact on app quality? Riiiiiight.

    “Fanboyism won’t win you any special seat at MIX this year”

    I live in Vegas and I don’t go to Mix. Conferences are pointless relics from the pre-web age. I might meet some nice people, but I can do that hanging out at the bars at Mandalay after hours.

  32. John C. Bland II Says:

    Hehe…cool beans man. Thanks for the reply.

  33. Greg Brown Says:

    Hi,

    For comparison, I implemented a version of this app using Apache Pivot. The results are here, if you are interested:

    http://ixnay.biz/pivot/1.4/demos/slide_gallery.html

    Greg

  34. Jack Bond Says:

    Your example is amazing on IE8, I’ve never seen:

    End tag ‘head’ does not match the start tag ‘link’. Error processing resource ‘http://ixnay.biz/pivot/1.4/demos/slide_galle…

    –^

    animate so smoothly. It’s like it isn’t even moving.

  35. Greg Brown Says:

    Thanks - hadn’t tested in IE. Should be fixed now. :-)

  36. Michael Reinhardt Says:

    Wow, Jack, your reply is amazing, I’ve never seen such pomposity demonstrated with such ease.

    It reads so easily. It’s like you /really are/ an ass.

  37. Jack Bond Says:

    Thank You! I must admit it though, I had to work on it. Just like James Gosling really had to work hard to make a language that sucks as much as Java. There are tons of reasons that Java isn’t used as a client framework, and JavaFx has simply added to the pile. Pivot seems to be so irrelevant, it doesn’t even have a Wikipedia entry.

  38. Greg Brown Says:

    Great suggestion, Jack - thanks. I just created a Wikipedia entry for Pivot.

  39. Walter Schreifels Says:

    One big advantage of Apache Pivot is it’s Open Source ( and it’s improving every minute ) under the Apache License, next is that it can run as a normal desktop application w/o changing any of your pivot code 100%, and last, imo, Apache Pivot is the answer to the replacement of Swing.

    I’m currently using Apache Pivot and it’s awesome!

  40. Jack Bond Says:

    An open source framework built on top of a closed source platform. Woohoo. Yet another UI framework, how many is Java up to now, 8000? Have they implemented LINQ? How about runtime generics? How about delegates, or is Gosling still being a deuche bag about those? Java, particularily on the client, is a total unmitigated disaster. You like Pivot, some other developer likes JVomit, another one likes, JPuke. They all do the same thing, but in completely different ways. What a horrific development ecosystem.

  41. Michael Reinhardt Says:

    Jack, I love the fact that you’re the Microsoft ambassador here.

  42. John C. Bland II Says:

    @Reinhardt
    I know right. :-D

  43. Jack Bond Says:

    More like the common sense ambassador. Just google ‘java is dead’ and never mind whether you agree with any of the arguments, the fact that people are having the discussion is a pretty strong indicator where the industry is headed. It was a piss poor client platform from day one, and the morons at Sun could never figure out why.

  44. John C. Bland II Says:

    @Jack Bond
    Oh you mean the platform I can deploy across multiple servers (not just Windows), there are thousands upon thousands of great predeveloped components/libraries built, and integrates with practically anything? That one? Yep…she’s a goner. :-D

    Nah…seriously though. I LOVE Microsoft dev products but you have to open your mind Jack. C#/.NET is not the best platform for every scenario. C# just got delegates so was it a poor language before then? 4.0 brings new stuff to the table other languages have had for a while. Does that mean C# 3.0 is bad? Nope.

    Just open your mind man…the world doesn’t revolve around .NET.

  45. Walter Schreifels Says:

    @Bond, Jack

    closed source platform? The Java platform?

  46. alikos Says:

    Я, хоть и не ваш постоянный читатель, но всё же скажу свое мнение. На ваш блог попал совсем случайно. Однако нашел много чего нового и интересного. Так что, как говорится, пиши еще :)

  47. Dave Vaughan Says:

    Couple of things, that have been commented on but not rectified/adressed.

    The test isn’t valid unless you use the same tween for both examples. It doesn’t need to be a fancy bounce, just make it the same.

    The alpha on the control buttons. is this a limitation oif silverlight ?

    I’m a senior flash developer in my company and have just installed the vs 2010 beta 2 and was thinking about playing with some silverlight, as the limitations of flash just get annoying at times. Its great for simple or complex websites but technology demos and dazzling that we have to do in the advertising industry tend to start showing stressed seams.

    I looked at the 3d one you did, much better as the animations were the same for each. Silverlight actually outdid flash for me, most natably in the 100 picture animation. Which was surprising.

    Thanks.

  48. J.l Says:

    you can remake the silverlight version in blend 3 in a minute or two using only the mouse, no code

  49. Всеволод Says:

    Ну точно, как люди говорят, любопытное рядом! :)

  50. Eloise Stgermaine Says:

    Sorry, aber das bezweifel ich ganz stark…

  51. etubez Says:

    that is great. silverlight is good.

  52. Michelle Says:

    I just love FLASH!! Adobe has every reason in the world to make Flash work on as many platforms as possible, while MS has as strong reasons to ensure Silverlight does NOT run (properly) on non-windows platforms. :-P

  53. Nitro Force Says:

    The problem is the yet another plug-in issue. It’s true that most people have Flash because of Youtube.com Needing to install another plug-in environment is becoming a very large hurdle for content providers. Also, consumers don’t want to return to the situation in the late 1990s when we needed a dozen plug-ins to view video from our favorite sites, each of which needed at different plug-in. Consumers are saying, well we’ve already got flash installed, why shoul d we installand maintain another plug-in environment.

  54. Justin L Says:

    ^^ “Consumers are saying, well we’ve already got flash installed, why shoul d we installand maintain another plug-in environment.”

    why? features, performance.

    also, silverlight is the binary platform used on windows phone. writing an applet once and publishing it on the web and also a major mobile platform is just good business.

    also, silverlight has DRM. content owners like DRM.

    also, silverlight is based on a variant of the .NET runtime, making a huge amount of source code, documentation, and tools available to application developers. flash lives in a closed ecosystem.

    also, silverlight is based on standards ratified by bodies like the ISO. parts of flash are loosely based on standards but it mainly just has some poor and outdated vendor documentation efforts.

  55. Jack Bond Says:

    “Consumers are saying”

    Yah, that’s what consumers or saying. Or rather you just pulled that out of your rear end. “Install and Maintain?” Seriously, I don’t even know what crevice you pulled that one out of. Click, 5 seconds later, done. Silverlight and Flash aren’t 300MB behemoths that require IT teams to manage. There was some moron from Adobe, I think his name was Ted, on the Silverlight forums a couple years ago, and his most compelling reason for using Flash or Silverlight was the installed base. As if end users were picking between MS Office and Star Office. If the first thing that comes to mind in what sets you apart from your competition is that you’re installed, you might as well close shop.

    The dopes at Adobe can’t even figure out how to implement threading. Add them to the list of companies Microsoft destroyed, it’s only a matter of time.

  56. Justin L Says:

    once upon a time java was the big thing and flash was the hopeless/pointless/deficient newcomer according to sun and the java community, but better technology (mainly vector graphics) won the day and now java is on life support

    also i forgot a critical point: security. flash seems to be an endless source of fun for malware people.

  57. John C. Bland II Says:

    Hey folks, I suggest a bit of research before making broad claims (ie - malware fun box, Adobe can’t figure out threading, etc). I have no intention in arguing these points but find it prudent for you guys to learn a bit more before making false statements/assumptions.

    @Nitro
    Flash had 99.8% penetration before YouTube existed. YouTube merely increased the adoption rate. That’s wildly different than being the reason why most have Flash since most already had it.

  58. Justin L Says:

    http://www.google.com/search?q=flash+vulnerability

    there’s practically been a flash security issue on a weekly basis for years, and if you include pdf/adobe reader, adobe has really been in a league of their own for creating vulnerabilities for malware vendors to exploit

  59. John C. Bland II Says:

    Again, research and provide specifics as to what is the actual culprit. Blanket Google slaps aren’t proof. Some of those links point to vulnerabilities in ActiveX or some other component, which affects the runtime.

    Understand I’m not saying Flash has no security issues but all software does (Silverlight, Java, QuickTime, Safari, and even this OS I’m typing on had a security update this week). It isn’t uncommon in software.

    You’ll have to do better than that though. Prove to me Flash is an “endless source of fun for malware people.”

  60. Jack Bond Says:

    @JohnC
    Broad claims? Your problem John is that I know SO much more than you that you’re not even in the same league. Here educate yourself,

    http://blogs.infosupport.com/blogs/alexb/archive/2010/03/01/flex-4-a-multi-threading-solution.aspx

    Green threading is not threading, and as processors become more parallel this becomes an even worse of a problem. So, like I said, Adobe can’t even figure out threading.

    Now, let’s consider Flash vs Silverlight in the context of security. One is remarkably secure, I can’t even recall a single issue in the last couple years. The other is a complete and total security joke. This shouldn’t come as a surprise though. Developing secure applications is difficult, and if you can’t even figure out threading, well, you’ve got problems.

    Finally, a demonstration of how to make a new native operating system thread in Silverlight.

    Thread newThread = new Thread(EntryPoint);
    newThread.Start();

    And the equivalent in Flash…

    Research the web for a few hours and realize it’s impossible, you’ve selected a crap platform.

  61. Сергей Александров Says:

    Народ в таких случаях так говорит - Авось задатка не дает. :)

  62. Da Says:

    Da Fake da mara..

  63. Ok Mcpadden Says:

    Hi, I like the Shrek movies, very good animation!

Leave a Reply