locked
FlipView simple example and fadeOut property error

    Question

  • Hello guys.

     

    I've built a new JS fixed layout application in vs2011 ultimate and I'm trying to reproduce the code shown here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465425.aspx

     

    I've adapted the code so that it uses the default png files. here's the code I have in the HTML page:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />  
        <title>Demo</title>
        <!-- WinJS references -->
        <link rel="stylesheet" href="/winjs/css/ui-dark.css" />
        <script src="/winjs/js/base.js"></script>
        <script src="/winjs/js/wwaapp.js"></script>
        <script src="/winjs/js/ui.js"></script>
        <script src="/winjs/js/controls.js"></script>
        <script src="/winjs/js/uicollections.js"></script>

        <!-- Demo references -->
        <link rel="stylesheet" href="/css/default.css" />
        <script src="/js/default.js"></script>
       
    </head>
    <body>
       
        <div id="basicFlipView" data-win-control="WinJS.UI.FlipView">
            <img alt="Banana" src="images/cliff.jpg" />
            <img alt="Mint" src="images/grapes.jpg" />
            <img alt="Orange" src="images/image1.jpg" />
        </div>
        <p id="info">

        </p>
    </body>
    </html>

    And  here's my js code:


    (function () {
        'use strict';
        // Uncomment the following line to enable first chance exceptions.
        // Debug.enableFirstChanceException(true);

        WinJS.Application.onmainwindowactivated = function(e) {
            if (e.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
               
            }
        }

        document.addEventListener("DOMContentLoaded",
            function () {
                WinJS.UI.processAll()
                        .then(function (){ },
                        function (err) {
                    var str = err + "<br>";

                    for (var prop in err) {
                        str += prop + ": " + err[prop] + "<br>";
                    }
                    document.getElementById("info").innerHTML = str;
                });
            });
       
        WinJS.Application.start();
    })();

    When I try to run my app, I end up with an error which says something like:

    TypeError: Unable to get value of proeprty 'fadeOut': object is null or undefined

    I've already downloaded the samples and the FlipView is working there. Can anyone point me to the right direction?

     

    thanks.

     


    Luis Abreu
    Wednesday, November 23, 2011 11:53 AM

Answers