By just adding a little more on the Carousel, you can create a brand new Crousel effect. Today, I am presenting you the advanced Carousel Effect which support various layers with additional Drill Down and Drill Up effects.
You can also experience how did I simulate the frame based animation by StoryBoard. A pretty good reference for you to learn Silverlight.
Comparison
Flash implementation: 50 minutes
Silverlight implementation: 1 hour (Implemented First)
What’s the difference?
- Tween [AS3] vs Storyboard [C#]
Source codes
Image Advance Carousel [Flash 9, AS3] (235.5 KiB, 3,380 hits)
Image Advance Carousel [Silverlight 2, C#] (298.5 KiB, 6,256 hits)
Flash
Silverlight
Tween [AS3] vs Storyboard [C#]
In AS3, the Class fl.transitions.Tween is very similar to StoryBoard in C#. Below is a simple demonstration which fade out an object in 3 seconds.
// AS3
import fl.transitions.*;
import fl.transitions.easing.*;
var storyBoard:Tween = new Tween(displayObject, "alpha", None.easeOut, 1, 0, 3, true);
storyBoard.addEventListener(TweenEvent.MOTION_FINISH, on_motion_finish);
function on_motion_finish(e:TweenEvent):void{
trace("finish");
}
What about in C#? let’s see how can we create Storyboard purely by code. Please be careful when using Storyboard.SetTargetProperty, you have to use “(LayoutRoot.Opactiy)” as the argument, don’t miss out the blankets!
There has been many chances on the Storyboard since Silverlight 1. You will find a lot of “wrong” information from the Internet which can not work properly in beta 2.
// C#
Storyboard storyboard = new Storyboard();
DoubleAnimation doubleAnimatoin = new DoubleAnimation();
doubleAnimatoin.From = 1;
doubleAnimatoin.To = 0;
doubleAnimatoin.Duration = new Duration(new TimeSpan(0, 0, 3));
Storyboard.SetTarget(doubleAnimatoin, displayObject);
Storyboard.SetTargetProperty(doubleAnimatoin, new PropertyPath("(LayoutRoot.Opacity)"));
storyboard.Children.Add(doubleAnimatoin);
storyboard.Begin();

September 20th, 2008 at 10:03 am
how about mouse moving support? you hold down mouse, move it left, the images will rotate from right to left, and vice versa.
and faster you move, faster the rotating speed goes.
September 21st, 2008 at 2:53 am
What file is the Storyboard storyboard = new Storyboard code located in? I don’t seem to see that block of code in the files.
September 21st, 2008 at 7:02 am
Hi Terence,
You have done a lot of very nice work - thank you for taking the time and effort to share these examples.
David Roh
September 22nd, 2008 at 12:45 am
I love how most of these examples have “Silverlight is better” as the winner, yet the Silverlight version is slower and sometimes doesnt even work in a browser other than IE. I’m in Chrome right now and it only updates if i scroll the page, but the Flash version works flawlessly!
September 22nd, 2008 at 1:42 am
unruledboy, it’s a good suggestion. I will try to see if I can implement later on.
Paul Gregoire, I think one of the main reason is that I made more promotion of this blog to silverlight network.
September 22nd, 2008 at 1:44 am
David Roh, thank you for support. I will contine to share to the community.
By the way, I have just viisted your website. Is it a new website? Cos I saw there is one page now. I really want to learn more about that.
September 23rd, 2008 at 4:45 pm
Image is blurry in flash version. Clearly silverlight is a winner here(according to me)
September 23rd, 2008 at 4:58 pm
@Paul, I am in Chrome right now and Silverlight example works ok, but you have to use Chrome developer build version, since Chrome team fixed some of the problems with Silverlight controls.
September 24th, 2008 at 12:27 am
Images are blurry in Flash Version where as they look normal in Sivlerlight.
September 24th, 2008 at 1:02 am
Venkat, the blur effect is mainly due to the fact that I have set the JPG quality to 80% when compiling swf.
September 25th, 2008 at 2:04 pm
[...] at CodeCamp 10 in Waltham MA, and has all his materials available… so what if you didn’t go?? Flash vs Silverlight: Image Advance Carousel Terence Tsang may have yet another demo up, but this is the one I captured this morning before a [...]
September 26th, 2008 at 10:11 pm
I laugh at the “it doesn’t work in Chrome” comments. In my opinion - Chrome doesn’t properly render code. Use a better broser, get a better experience. It seems everytime a browser developer “accidently” disables some microsoft functionality, Microsoft gets the blame, but the truth is, they have really pushed the envelope to make the web experience richer and more engaging. Mozilla took a long time to catch up - and now offers a great plugin architecture. Chrome is new and will need alot of work - unless their plan is to provide a browser that is faster, because it skips alot of functionality.
I develop in both Flash and Silverlight, and love both. Flash is more widely adopted, for now, but Silverlight offers a great approach for designers to rapidly create rich UIs. Flash takes more time to learn and is not the most intuitive development tool.
September 27th, 2008 at 2:27 am
RK. I love both of the technology too. Just to add a little bit more. Though Flash may be difficult for learning, but I think it provides a much better environment for making animations. That’s quite important for those deisgners who don’t know coding.
October 17th, 2008 at 6:57 pm
Brilliant example. I was trying to do something alike but continuously messed up in all my attempts. Thanks for sharing and keep up the good work.
October 18th, 2008 at 10:50 am
Thank you for valuable information.
November 16th, 2008 at 2:30 pm
..was just passing by.. good work
February 9th, 2009 at 6:57 am
Hello,
In the website i am working on images and videos are blurry. The website coded by Flash, and i am an intern . That is why; i do not have a lot of experience. Can someone tell me why work samples are blurry. I would be glad if you can explain in detail.
Thanks a lot.
March 9th, 2009 at 7:29 pm
Hi - a great set of articles and I hope you enjoyed making them. My only suggestion is to blind ‘diet coke test’ your samples for the vote to get the most accurate user polling.
March 29th, 2009 at 12:43 pm
Why flash images are compressed like shit and the silverlight use the png version? Just like the video, totally unfair comparisons. Just say you are paid, or you should be.
March 30th, 2009 at 9:25 am
Honest, I am not paid. That’s why I won’t spend too much time to make everything exactly the same.
April 7th, 2009 at 11:13 pm
flash is deffinetly better
I want to see silverlight manage to do this liquify effect as seen here
http://www.activate.co.il
October 11th, 2009 at 3:50 am
Flash screws up the image quality.
Compare the image quality between flash and silverlight.
November 20th, 2009 at 6:00 am
Can u tell me the complete code to make this
code to make this
April 16th, 2010 at 5:18 am
Did you know it’s easier to write that for Silverlight and WPF using Artefact Animator - http://artefactanimator.codeplex.com/
ArtefactAnimator.AddEase( LayoutRoot, OpacityProperty, 0, 3, AnimationTransitions.CubicEaseOut ).Complete += (e, p) => Debug.WriteLine(”Animation Complete”);
May 2nd, 2010 at 12:32 am
hello!, thanks for the info, this post was very useful ! avafx forex broker
June 22nd, 2010 at 2:42 am
Thanks for sharing this excellent silverlight app, can i expect more carousel things from you. as im a designer no knowledge of programing.
July 14th, 2010 at 2:41 am
[...] Flash Silverlight Download [...]
December 22nd, 2010 at 3:32 am
I am not quite skilled in programming. WPF baffles me everytime I try to translate what I know from Adobe Flash. This post is very helpful for me. First, it showed, in a simple way, how Flash differs from Silverlight. Moreover, This application is a wakening call for my programming over rich media user interface. It actually showed me how to start everything in Silverlight from coding. And those code resembles to those in actionscript.
I found that in Adobe technology, we could have everything visual from the class MovieClip or Sprite. However, in Microsoft, we have a bunch of them such as ContentControl, UserControl and so on. I mean the .NET Framework is better organized but way too much complicated for me to grasp every detail.
The source code is well organized and robust at the moment. Thanks very much for sharing.
April 6th, 2011 at 1:30 pm
There are a TON of survival books, websites, and “experts” out there that have terrific information, but people make the mistake of thinking that reading a book means you’ve got a workable plan. In addition, all of them miss one of the seven key factors for helping you create the perfect survival plan.
May 15th, 2011 at 4:07 pm
hello! ;) im at the office right now, thus i do not have much time to write… nonetheless! I truly enjoyed reading through the post. It was a bunch of excellent stuff. thank you! Best regards, Resor
May 26th, 2011 at 11:59 pm
Congratulations for the outstanding weblog posting! I discovered your submit really interesting, I think you’re a intelligent writer. I add in your blog to my bookmarks and will return inside the lengthy term. I want to inspire you to continue that marvelous function, have a great day!