Flash vs Silverlight: Custom Loading Splash Screen Flash vs Silverlight: Orbiting Text around an object
Mar 03

It has been a long time that I didn’t implement text effect comparison. Text Rendering is a very interest topic when comparing Flash and Silverlight. It’s because they have different rendering system which result in a dramatic differences on performance and readability.

If you are going to make animations using text, I am sure Flash is much more better. Take a look on my previous sample “Text Tunnel“.

Nevertheless, I didn’t stress on performance for this entry. Instead, you could see how I handle Color Animation differently.

Comparison

Flash implementation: 1 hour 20 minutes (Implemented First)

Silverlight implementation: 1 hour

What’s the difference:

  • Color Animation: Timeline method (Flash) vs ColorAnimation (Silverlight)

Source codes

Flash

Silverlight

Color Animation: Timeline method (Flash)

Tween Class in AS3 is not able to modify the color of an object. Of course, you may still modify the color integer value directly. However, the value is calculated in a linear way and it will not be what you are looking for.

Let’s back into basic, we are still able to tween the color of an object using the timeline approach. I won’t go into too much details here since it’s a bit hard to describe. You may download the source code and study it on your own.

ColorAnimation and StoryBoard (Silverlight)

For Silverlight, we may tween the color of an UI object using the following code:

// C#
// create a text block
TextBlock textAnimation = new TextBlock();
textAnimation.Text = "Text";
textAnimation.Foreground = new SolidColorBrush(Colors.Black);
LayoutRoot.Children.Add(textAnimation);

// add a new story board to fade out the text color
Storyboard moveStoryboard = new Storyboard();

ColorAnimation colorAnimation = new ColorAnimation();
colorAnimation.To = Colors.White;
colorAnimation.Duration = new Duration(new TimeSpan(0, 0, 0, 0, FADE_DURATION));

Storyboard.SetTarget(colorAnimation, textAnimation);
Storyboard.SetTargetProperty(colorAnimation, new PropertyPath("(TextBlock.Foreground).(SolidColorBrush.Color)"));
moveStoryboard.Children.Add(colorAnimation);
moveStoryboard.Begin();

Shares and Enjoy~

Did you like this post?

Subscribe here:  

14 Responses to “Silverlight vs Flash: Matrix Text Effect”

  1. Philippe Says:

    Man you’re making both Flash and C# look bad with your examples…

    For Flash color tweening, if you’re not a poor newbie, you’re using tween classes like TweenLite, Tweener, gTween, etc. which perfectly and easily tween about anything, including colors and volume.

    // complete color & position animation in one line instead of 18 in C#
    TweenLite.to(target, time, { tint:targetColor, y:targetY });

  2. Alan Churchill Says:

    I think the comparison is valid because you can easily write an extension method to hide the C# code but that really isn’t the point. There are loads of libraries out there to simplify tasks in .NET, Flash, whatever but I think sticking to what is in the core code is fine and a good comparison.

  3. vCracker Says:

    I think there is some problem with the silverlight version, after going to half of the screen(bottom part), letters are not rendered as in the upper half part.

  4. BigBen Says:

    Unhandled Error in Silverlight 2 Application Value was either too large or too small for a character. at System.Convert.ToChar(Int32 value)
    at MatrixTextEffect.TextColumn._timer_Tick(Object sender, EventArgs e)
    at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
    at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

  5. admin Says:

    vCracker and BigBen:

    My coding is not good enough to run in various computers. Anyway, I have fixed the problem. You may clear the cache and see the new version.

    Philippe, thanks for the suggestion, those Tween Class are very useful. Hope we can have something similiar in Silverlight.

  6. Steve Buchok Says:

    In the Silverlight version I only see one line (with shadows) of text scrolling down.

  7. zonedj Says:

    The silverlight example goes into alternate characters when it leaves your screen and when it comes back into your field of view it appears to have to purge the task and restart. Does this have to do with the random character generation? Either way this could pose issues for developers.

  8. sean fox Says:

    AgTweener for Silverlight on CodePlex here:
    http://agtweener.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=14398

  9. awais_champ Says:

    the silverlight version has some problem text is not showing properly

  10. shaneali Says:

    How can i change text to only “1″ , ” 0″ in flash version

  11. LOOOOL Says:

    Silverlight is hanging if you scroll fast up an down an stop then

  12. Matrix Text Effect | Silverlike - A Free Microsoft Silverlight 3 Directory Says:

    [...] A matrix text falling effect created by Terence Tsang. [...]

  13. Carl Says:

    Thanks, was interesting to see the 2 running in the same browser. I’m still not convinced silverlight is reliable.

  14. Durga Das Says:

    one of the wonderful website i ve ever seen …. thank u very much…

Leave a Reply