locked
Splash screen sample not working in blend RRS feed

  • Question

  • Hi,

    I added an extended splash screen similar to the sample. It works fine in visual studio, but if I open in blend it gives error and doesn't start.  I opened the splash screen sample in blend, that too gets stuck with error.  Any way to get it working in blend?

    Tuesday, February 19, 2013 2:03 PM

Answers

  • Hello, is this the error you are seeing in Blend when opening the splash screen sample?

    "Unable to get property 'imageLocation' of undefined or null reference"

    If so, you can update the activated function in default.js to check the splash variable for null and default.html will load in Blend with no errors. You will need to run the app (via F5 or Ctrl+F5) on your local machine or in the simulator to interact with the splash screen, it is not available in Interactive Mode.  

    Here's an example of what I changed in default.js in the SDK sample.

    function activated(eventObject) {
      if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
      // Retrieve splash screen object
      splash = eventObject.detail.splashScreen;
    
      if (splash) {
        // Retrieve the window coordinates of the splash screen image.
        SdkSample.coordinates = splash.imageLocation;
    
        // Register an event handler to be executed when the splash screen has been dismissed.
        splash.addEventListener("dismissed", onSplashScreenDismissed, false);
    
        // Create and display the extended splash screen using the splash screen object.
        ExtendedSplash.show(splash);
      }
    
      ...

    I hope this helps. Please reply if you have further questions.

    thank you,
    Joel

     
    • Marked as answer by ner9G Friday, March 1, 2013 10:08 AM
    Friday, March 1, 2013 6:19 AM

All replies

  • Hi,

    If you use a Visual Studio template to create your app, "images\splashscreen.png" is added to your project and automatically set as the splash screen image for your app in the "package.appxmanifest" manifest file.

    #Quickstart: Adding a splash screen (Windows Store apps using JavaScript and HTML) (Windows)

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465346.aspx

    #Guidelines and checklist for splash screens (Windows Store apps) (Windows)

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465338.aspx


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 20, 2013 6:53 AM
  • Does blend support splash screen, why is the splash screen sample not opening with blend? but works as it should in visual studio.

    Friday, February 22, 2013 5:03 AM
  • Hi,

    Blend support splash screen. And I have tested on my side. Please have a check. Or upload your sample to skydrive.


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 25, 2013 8:43 AM
  • May be something with my blend, I downloaded a fresh copy of the sample yet the same behaviour. Couldn't interact with the sample in interactive mode. But works fine in visual studio. A screen shot in interactive mode is below.

    Tuesday, February 26, 2013 6:39 PM
  • Hello, is this the error you are seeing in Blend when opening the splash screen sample?

    "Unable to get property 'imageLocation' of undefined or null reference"

    If so, you can update the activated function in default.js to check the splash variable for null and default.html will load in Blend with no errors. You will need to run the app (via F5 or Ctrl+F5) on your local machine or in the simulator to interact with the splash screen, it is not available in Interactive Mode.  

    Here's an example of what I changed in default.js in the SDK sample.

    function activated(eventObject) {
      if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
      // Retrieve splash screen object
      splash = eventObject.detail.splashScreen;
    
      if (splash) {
        // Retrieve the window coordinates of the splash screen image.
        SdkSample.coordinates = splash.imageLocation;
    
        // Register an event handler to be executed when the splash screen has been dismissed.
        splash.addEventListener("dismissed", onSplashScreenDismissed, false);
    
        // Create and display the extended splash screen using the splash screen object.
        ExtendedSplash.show(splash);
      }
    
      ...

    I hope this helps. Please reply if you have further questions.

    thank you,
    Joel

     
    • Marked as answer by ner9G Friday, March 1, 2013 10:08 AM
    Friday, March 1, 2013 6:19 AM
  • Yes, that's the error I see in blend.

    After the change I could use blend interactive mode with my app too. Thanks.

    Friday, March 1, 2013 10:11 AM