Using a javascript file from several QML files
-
I'd like to use the same instance of a javascript game logic file from several QML files, so I suppose I should import it once in my main QML and refer to it somehow (as discussed in "this thread":http://www.developer.nokia.com/Community/Discussion/showthread.php?223175-Troubles-setting-js-global-variables-from-QML-file). How do I do that though? In the main QML file I can refer to the javascript file by the string after "as" in the import statement. That does not work for the other files, I just get a "ReferenceError: Can't find variable". How can I make them aware of the javascript logic?