Flash vs Silverlight: Controlling UI Object Silverlight vs Flash: Matrix Text Effect
Feb 26

If you want to make a fully personalized Silverlight or Flash application, then you shouldn’t miss out this post.

Splash Screen is a very user friendly way to notice how long you have to wait for the application to load. You may also add some graphics, advertisements or animations to entertain the users before the they get bored by waiting.

Flash and Silverlight have completely different mechanisms in adding the splash screen. Before we start, let’s take a look on the comparisons and demo first.

Comparison

Flash implementation: 30 minutes

Silverlight implementation: 50 minutes (Implemented First)

What’s the difference:

  • Creating Loading Splash Screen

Source codes

Demo Samples:

Creating Loading Splash Screen in Flash

Adding Splash Screen in Flash is not as easy as you can imagine. Unless you are loading an external swf, otherwise you have to do a lot of preparation in making the Splash Screen. Another alternative is that you may try to use Flex. It provides a much more convenient way to add splash screen.

Usually, the main problem is that the ActionScript will only execute once everything is downloaded. In such circumstance, you have no way to display loading details.

The main cause is that when you export Movie Clip, you will usually check the box “Export in First Frame”. It means that this movieclip will be downloaded before the swf will execute.

However, if you don’t check this item, some of your resources may not be included into the swf during compile time.

Therefore, to get rid of this, you should put your MovieClip onto the stage. This makes sure that the Flash will include this resource as well.

Well, it sounds difficult, right? Anyway, if you are still interested, download my sample source code and see how it works.

Creating Loading Splash Screen in Silverlight

Splash Screen in Silverlight is independent with the application. It means that you can apply different kind of splash screen without modifying the application. You may even share your splash screen design with others!

Anyway, let me show you the minimal steps in creating your own splash screen.

  1. First of all, create a SplashScreen.xaml file and add the followings:
  2. <Canvas
       xmlns=”
    http://schemas.microsoft.com/winfx/2006/xaml/presentation”
       xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
       Width=”550″ Height=”550″>
      <Grid>
        <TextBlock Text=”Loading: 0%” x:Name=”Label”/>
      </Grid>
    </Canvas>

     

  3. Open the html that hold your Silverlight Application. Add a new parameter to the embed syntax.

    <param name=”splashscreensource” value=”SplashScreen.xaml”/>
    <param name=”onSourceDownloadProgressChanged” value=”onSourceDownloadProgressChanged” />

    Please make sure that the SplashScreen.xaml is placed in the same folder with the html.

  4. Add the below JavaScript function
  5. function onSourceDownloadProgressChanged(sender, eventArgs)
    {
        sender.findName(”Label”).Text =  “Loading: ” + Math.round((eventArgs.progress * 1000)) / 10 + “%”;
    }
     

  6. Lastly, make sure you application is big enough or you will never see your own splash screen.

For more information, please refer to: Define a Simple Silverlight Splash Screen

Shares and Enjoy~

Did you like this post?

Subscribe here:  

11 Responses to “Flash vs Silverlight: Custom Loading Splash Screen”

  1. Maciek Says:

    Hello Terrence, it’s been a while. Quick question : can a Splashscreen be created if I use an *.aspx file instead of *.html? For some reasons I need to have a code-behind file for the webpage.

  2. Vasile(thebookle.com) Says:

    “Another alternative is that you may try to use Flex. It provides a much more convenient way to add splash screen.”
    Because you use xaml, you should compare Silverlight with Flex: Silverlight XAML+C#(or other .NET language) vs MXML+Actionscript 3. So, in my view it is not a fair comparison XAML + c# vs pure flash AS3

  3. Eman Says:

    @Maciek: Are you referring to using an ASP.Net control instead of the object tag? If so, you can define those values in the properties of the control like so:

  4. Eman Says:

    The code wasn’t displayed so here are the properties that you need to set in the ASP.Net control

    SplashScreenSource=”~/Splash/SplashScreen.xaml”
    *and*
    OnPluginSourceDownloadProgressChanged=”onSourceDownloadProgressChanged”

  5. Vitor Canova Says:

    @Vasile(thebookle.com) Says: “Because you use xaml, you should compare Silverlight with Flex: Silverlight XAML+C#(or other .NET language) vs MXML+Actionscript 3. So, in my view it is not a fair comparison XAML + c# vs pure flash AS3″.
    If you want to compare the powerful language of Adobe like Flex you need to compare with Microsoft XAML Browser Application with the full power of .NET framework.

    In this blog is used only simple plugins tecnology.

  6. admin Says:

    Maciek, you may refer to Eman’s reply.

    And for the comparison, I didn’t just focus on comparing their technology, but also demonstrate how to achieve it.

  7. Vasile(thebookle.com) Says:

    To Vitor Canova:
    Xaml Browser Applications need full .net framework installed on client machine, flex needs just flash runtime, so flex can be compared just with silverlight applications that requires just silverlight runtime

  8. Scott Willeke Says:

    What am I missing? I read the code for each sample and it seems obvious that the flash samples i much easier and cleaner implementation with exactly the same results. Yet, the votes are all for SL. What did I miss?

  9. Todd Herman Says:

    THis is about the 5th example I have tried over the weekend. For some reason, I acan’t get any spash screen (including the default) to display. I have even added 50MB of bloat to my XAP and I still get nothing but a pause before the page is displayed.

    Has anyone else run into this issue? I am beginning to suspect some configruation issue.

  10. kong Says:

    @Todd Herman
    I have also run into this issue, and I also do not understand why the splash page will not load.

  11. online bollywood movies free Says:

    Hello, I found your blog in a up-to-the-minute directory of blogs. I dont know how your blog came up, have got to produce been a typo, Your blog looks pleasant. Have a fine daylight.

Leave a Reply