views:

624

answers:

1

Here is my problem - I'm trying to write a self-updating application, but I keep getting an error saying that runtime.air.update.ApplicationUpdaterUI() does not return a constructor.

Here's the relevant section of the code; there are other javascript files being included, but I don't think that any of them would be actively breaking AIR itself.

<html>
<head>
<script type="text/javascript" src="./js/AIRAliases.js"></script>
<script type="text/javascript" src="./js/jquery-1.3.1.js"></script>
<script src="ApplicationUpdater_UI.swf" type="application/x-shockwave-flash"></script>
<script>
    $(document).ready( function() {
        var appUpdater = new runtime.air.update.ApplicationUpdaterUI();  // line 64 in this example
    }
</script>
</head>
<body> ... stuff ... </body>
</html>

And the error that I get when I test it is

    TypeError: Value  is not a constructor. Cannot be used with new.
     at app:/index3.html : 64
     at app:/js/jquery-1.3.1.js : 2912
     at app:/js/jquery-1.3.1.js : 686
     at app:/js/jquery-1.3.1.js : 2916
     at app:/js/jquery-1.3.1.js : 2936
+2  A: 

Verify the path in that script tag for the SWF, I'm guessing you do not have the reference to the ApplicationUpdater_UI.swf correct.

Air is basically complaining that it cannot find a runtime.air.update.ApplicationUpdaterUI() method to call anywhere, which likely means it can't find the SWF (or I suppose it's possible the SWF is corrupted).

Peter Richards
If your gonna accept the answer, least you could do is up-vote it. Ah well, good answer Peter.
Brian Hodge